Sort du output by folder size

Easiest way to sort subdirectory sizes:

du -h -d 1 |sort -k1 -rh

Where du -h -d 1 is used to show human readable format (-h) and only 1st level of subdirectory (-d 1).

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.