On Mon, 27 Jan 2020 10:33:49 -0700, Todd C. Miller
<mill...@openbsd.org> wrote:

> For example, I often do:
> 
>     du -sk * | sort -rn | head
> 
> to see the largest disk users.
> 
> However, output in kilobytes is less useful than it used to be due
> to larger files now being common.

Can't you achieve what you want with `du -sh * | sort -h`? du(1)'s -h
options will automatically select the best suffix and sort(1)'s -h
will sort first using the suffix then the numerical value.

Also if you don't sort -r, you don't need to `| head`.

Cheers,
Daniel

Reply via email to