Birds eye view folder used space, June 2, 2007Posted by sandakith in linux.
Here’s a handy command sequence which you can run anywhere, anytime, so see which directories contain the most amount of data. It’s a really useful way to focus your attention on the biggest users of disk space.
$ du -k . | sort -rn | less
* ‘du -kh .’ means “Show disk usage (in human redable format) for all directories in current directory”
* ‘sort -rn’ means “Sort in reverse numeric order (largest first)”
* ‘less’ is a handy favourite pager (When overflows output page).
This will give you a list of directory sizes followed by the directory name. The top ones are where you should focus your attention.