Mar 31

Size of a directory on Linux

linux shell

Disk usage du with size -s in a human readable -h format for the current directory.

du -s -h .

For all sub-dirs ./*, sorted by size (numeric -n). Don't use -h, otherwise 10M would be before 1G.

du -s ./* | sort -n

http://www.lifeaftercoffee.com/2006/04/04/how-big-is-that-unix-directory/

✱ ✱ ✱