help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Sorting directories by size


From: hancooper
Subject: Sorting directories by size
Date: Tue, 24 Aug 2021 14:49:49 +0000

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Tuesday, August 24, 2021 2:44 PM, Kerin Millar <kfm@plushkava.net> wrote:

> On 24/08/2021 15:31, Dennis Williamson wrote:
>
> > On Tue, Aug 24, 2021, 9:26 AM hancooper <hancooper@protonmail.com
> > mailto:hancooper@protonmail.com> wrote:
> >
> >     .
> >
> >     Have got almost what I'd like, except that tho sizes are not in
> >     human readable form.
> >
> >     find "$src" "${daggr[@]}" -type d -exec du {} + | sort -rn
> >
> >
> > Use du -h and feed it into the awk or gawk command in the stackoverflow
> > answer I linked in my recent message. And don't feed it any names
> > containing newlines.
>
> Please, let's not. The commands I have been proposing from the outset
> correctly handle arbitrary pathnames, provided that GNU coreutils is
> available. They only need to be applied correctly rather than be mangled
> into something else.

I like the `du` direction.  I have been wondering whether using `du -h0`
would create problems for sort because of the size letter.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]