Find Largest Files on Server

Sometimes its necessary to delete large log files or other data files taking up substantial room on your server. You can scan your directories and display files over 10MB using the following command:

find / -mount -noleaf -type f -size +10000k -print0 | xargs -0 ls -lhSr | perl -ne '/(\S+\s+){4}(\S+)\s+(\S+\s+){3}(.*)/ and printf("%*s %s\n",7,$2.":",$4);'

If you want to adjust the minimum file size just up the value +10000k to +50000k which would then only display files above 50MB

Posted In CategoriesSSH| Tagged Tags