Is there a terminal command to list folder size and corresponding file sizes within on Ubuntu 14.04 (Trusty Tahr)?

I like to use simply:

du -chd 1 | sort -h

It outputs the total size of each sub-directory from the current directory location (the "1" above), as well as a total of all sub-directories, and sorts it by human-readable sizes:

See how it looks here.


Yes, there is the tree command. Install it via sudo apt-get install tree, and type the following:

tree -h

From man tree:

-h    Print  the size of each file but in a more human readable way, e.g. appending a size letter for kilo‐
      bytes (K), megabytes (M), gigabytes (G), terabytes (T), petabytes (P) and exabytes (E).

Done :)


I found these helpful top 10 disk usages. For quick use, the command line is the following:

du -m | sort -nr | head -10

It lists all folders (including repetitive sub-folders) with most disk space usage sorted.

Tags:

Ubuntu 14.04