List directories size with the command line

Get a size sorted list of directories and their estimated size (file space usage) in linux.

Command

You can customize how deep you want to go, in the case below only first level folders will be listed.

du -h --max-depth=1 | sort -hr

Sample output

921M .
 128M ./02
 102M ./03
 93M ./01
 90M ./06
 88M ./05
 81M ./04
 74M ./09
 71M ./11
 70M ./12
 53M ./10
 43M ./07
 32M ./08

About Rick

Senior Front-end Software Engineer from Barcelona, Haidong Gumdo Instructor (korean martial art of the sword), street photographer, travel lover, TV addict, Boston Red Sox fan, and privacy advocate.

Leave a Reply

Add <code> Some Code </code> by using this tags.

*
*