commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
list the top 15 folders by decreasing size in MB
There are 9 alternatives - vote for the best!
I don't like doing a massive sort on all the directory names just to get a small set of them. the above shows a sorted list of all directories over 1GB. use head as well if you want.
du's "-x" flag limits this to one file system. That's mostly useful when you run it on "/" but don't want "/proc" and "/dev" and so forth. Remember though that it will also exclude "/home" or "/var" if those are separate partitions.
the "-a" option is often useful too, for listing large files as well as large directories. Might be slower.
If you can do better, submit your command here.
You must be signed in to comment.