Using unix command ‘du’, disk usage

Sometimes you like to know which folders are using up all your space on your Linux server.

This command will sum up the disk usage per folder, and print the result:

du -m --max-depth=10 / | sort -r -n | head -10

– m (display in megabyte)
– max-depth=10 (folder depth? Should be plenty, depends on your system)
– sort -n -r (sort it by numbers, and reverse it)
– head -10 (only show the 10 top folder with most data.)

result on “myserver”:

6268    usr
5330    var
3414    var/www
2715    backup
2714    backup/postgresql_dumps
2399    usr/share
2192    var/www/applications
2126    var/www/applications/logonlogoff
2034    var/www/applications/logonlogoff/cache
1691    usr/local

Leave a Reply

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