Saturday, February 20, 2021

du sort human-readable diskusage

 Something I remember looking up before a few times:

du -hs * | sort -h

(via this serverfault question)

That gets disk usage 'h'uman readable (i.e. Gb, Mb, K at different scales),  's'umarizes (so you don't get the detailed listing for every subdirectory) and then sort has a parallel 'h'uman flag to deal with the readable values.

No comments:

Post a Comment