List directory size one folder deep in human-readable form Linux
Submitted by Des on Thu, 08/13/2015 - 21:30
To list all the directories in a folder by size without giving all subfolders, a nice clear list with no clutter use
$ du --max-depth 1 -h
du = estimate file space usage
--max-depth 1 = only go 1 deep in the tree
-h = human-readable
For example
/var$ sudo du --max-depth 1 -h
21M ./log
4.3M ./backups
4.0K ./mail
5.5M ./crash
8.0K ./www
588M ./cache
4.0K ./tmp
56K ./spool
4.0K ./local
4.0K ./opt
551M ./lib
1.2G .
It also totals the whole directory at the end. Pretty cool.