Directory size from the cmd line

Have you ever wanted to scan recursively through a directory to find out how much space each sub directory was taking up? Well, there is an easy way of doing this on *nix. Just run du “Disk Usage”.

On a Darwin (OS X) based distro you can run: du -hd1 which tells du to render the results in [h]uman readable format and to traverse a max depth of 1. To achieve the same results on a Linux based w distro you can run du -h --max-depth=1 For further information (rtfm) refer to the man page.