kymbrik
11/17/2017 - 11:27 AM

Bash: How can I list out the size of each file and directory (recursively) and sort by size decendingly?

Simply navigate to directory and run following command:

du -a --max-depth=1 | sort -n
OR add -h for human readable sizes and -r to print bigger directories/files first.

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