Find Large Files Fast

We’ve all been there, your 10GB VPS server is running out of space or that 3GB virtual machine your using as a dev server is bursting at the seems and you need to free up some space quickly.
Use these searches to find the largest files on your server and start clearing up space for more 1′s and 0′s.
Find files over 1GB
sudo find / -type f -size +1000000k -exec ls -lh {} \;
Find files over 100MB
sudo find / -type f -size +100000k -exec ls -lh {} \;
Find files over 10MB
sudo find / -type f -size +10000k -exec ls -lh {} \;
The first part is the find command we’ve gone over before except this time we’re using the “-size” flag to find files over different sizes measured in kilobytes.
The last bit on the end starting with “-exec” allows us to specify a command we want to execute on each file we find. Here we’re executing the “ls -lh” command to include all the information we’re used to seeing when listing the contents of a directory. The h towards the end is especially helpful as it prints out the size of each file in a human readable format i.e. Megs and Gigs.
Happy pruning!
- http://www.davidglover.org/ David
- http://rawberg.com/blog David Feinberg
- betterdeal
