Try: du --max-depth=7 /* | sort -n - it won't just tell you directories, and there will be duplicates, but it will list everything 7 levels deep and sort them by size order.
I suggest you to use baobab, which will give you a graphical overview of your disk usage. It can also be used for remote folder (through ssh, ftp,...) to scan the disk usage on a remote server for instance.
Edit: If you would like to investigate the disk usage directly on the server with your shell access and not remotely, and you would like a tool more convenient than du, you can also have a try with durep which will generate a report of the disk usage with bar graphs.
I'm regularly running du -dak > du-dak.out at the top of each file system. Then, I can get a graphical display with xdu < du-dak.out. This can be done remotely after transferring the du-dak.out file over the network should you only have text access.
My favorite tool for this task is ncdu.
Try:
du --max-depth=7 /* | sort -n
- it won't just tell you directories, and there will be duplicates, but it will list everything 7 levels deep and sort them by size order.I suggest you to use baobab, which will give you a graphical overview of your disk usage. It can also be used for remote folder (through ssh, ftp,...) to scan the disk usage on a remote server for instance.
Edit: If you would like to investigate the disk usage directly on the server with your shell access and not remotely, and you would like a tool more convenient than
du
, you can also have a try with durep which will generate a report of the disk usage with bar graphs.I usually use something like this:
You can apply a depth restriction using --max-depth= if you don't want to see past a certain level from your target, like so:
Try
df
&du -sh /
. And recursivelydu -sh
. Not the best solution though.Something like
Will give you a quick answer (last entries are largest files/directories)
# cd /; du -shb | sort -nr > /root/home/disk-space-report.txt
I always use syntax like
du -sm --max-depth=4 /path/i/want/to/drill | sort -nr | head -n 20
.max-depth and head parameters can vary, of course, but the above would list 20 biggest directories.
I'm regularly running
du -dak > du-dak.out
at the top of each file system. Then, I can get a graphical display withxdu < du-dak.out
. This can be done remotely after transferring the du-dak.out file over the network should you only have text access.http://sd.wareonearth.com/~phil/xdu/