List size of directories in the current folder in terminal

October 5, 2015

If you would like to list the size of all the directories in your current folder run the following command:

[bash]du -a -h –max-depth=1 | sort -hr[/bash]

This will provide output similar to

[bash]
69M .
36M ./plugins
16M ./.git
14M ./themes
3.4M ./uploads
8.0K ./.DS_Store
4.0K ./upgrade
4.0K ./.revision
4.0K ./index.php
[/bash]

Leave a Reply

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