Skip to content

Instantly share code, notes, and snippets.



Last active Nov 10, 2015
What would you like to do?
Shell: Find & remove files bigger than X
# k: Kilobyte, M: Megabyte, G: Gigabyte
# +: Bigger than, -: Lower than
find . -maxdepth 1 -type f -size +500k -exec rm -f {} \;
# Or better:
find . -maxdepth 1 -type f -size +50M -delete
# Let's have a look first:
find . -maxdepth 1 -type f -size +2G -exec ls -lhS {} \; | awk {print $5 "\t" $9}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment