Friday, 17 June 2016

Search Large files on Linux



Ever wonder how to find large files in Linux but you have well there is the find command you can use here some examples I found really helpful.

To find files larger than 100MB:

find . -type f -size +100M

If you want the current dir only:

find . -maxdepth 1 -type f -size +100M

If you wish to see all files over 100M and to see where they are and what is their size try this:

find . -type f -size +100M -exec ls -lh {} \;

If you wish to check all the files in the system then run the command from the system root (/) directory with sudo.

cd \
sudo find . -type f -size +100M -exec ls -lh {} \;