Thursday, September 4, 2008

Finding large files on ubuntu/debian

Yesterday our LTSP server which runs on debian suddenly stopped working. After some investigation I found out that free hard disk space on the server was very low. The machine has 500+ accounts. I had to locate big files for back up.

The following code can be used for this.
 
$ find /home/sunil -type f -size +20000k -exec ls -lh {} \; | awk '{ print $8 ": " $5 }'


You can replace /home/sunil with what ever path you want to search. Also you can try changing the size from 20000k( 20MB) to some other value.

No comments: