How to look at the size of a list of directories. From time to time you need to look at the sizes of different directories to see how much space they are taking up. Here's a quick easy way to do this. Combining the ls command with the du command.
prompt$ ls -d */ | xargs -n 1 du -hs
This will give you output that looks like this:
-bash-3.00$ ls -d */ | xargs -n 1 du -hs
353M temp
301M www
135M www2
310M wine
299M junk
1.6G video
86M cgi
6.9G podcasts
Now it's easy to see where all the space is being used.
You can also add this to your profile and make your own command like this:
alias lsdir='ls -d */ | xargs -n 1 du -hs'