Tips: Finding Huge Files on Linux

I tend to always need to find the huge log files that are filling up servers. One fast way is to use find and awk to list them in human readable form:

find / -type f -size +20000k -exec ls -lh {} ; | awk '{ print $8 ": " $5 }'

Int he above example I am using find / which will search entire root filesystem. You can change this to /var/log of any path you want to find the largest files. You can also change the 20000k to a smaller or larger size (20000k = 19.53 MB).

 

Leave a Reply

Your email address will not be published. Required fields are marked *