top | item 40934465

(no title)

mshook | 1 year ago

I don't understand the point of the script, it's nothing more than:

  du -h --max-depth=1 "$@" | sort -hr

discuss

order

out-of-ideas|1 year ago

`-h` is not available in all `sort` implementations

BlackLotus89|1 year ago

Even the busybox port has it. The only sort implementation I know of that doesn't have -h is toybox (I guess older busybox implementations are missing it as well), but I'm using -h for well over a decade and seldom had it missing

INTPenis|1 year ago

I found this online a long time ago, and it's been with me across BSD, Macintosh and Linux. So I can't say why it is that way, and I didn't know about sort -h before today.

dotancohen|1 year ago

The point is that it is faster.

zamadatix|1 year ago

A bash script for postprocessing the sorting is certainly slower than just having sort do it correctly in the first place.