List directories size with the command line

Here's how to list a directory size from the terminal.

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


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

Leave a Reply

Your email address will not be published. Required fields are marked *