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”: