less than 1 minute read

du -hsc * | sort -h

What each option means for du:

  • -h (or –human-readable): show sizes in human readable format (1K, 1M, 1G, …)
  • -s (or –summarize): display only a total for each argument
  • -c (or –total): also display a grand total

The -h (or --human-numeric-sort) option on sort makes it understand the -h format (human readable) on du.

Via SuperUser.

Tags: ,

Categories:

Updated:

Leave a comment