bug-coreutils
[Top][All Lists]
Advanced

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

bug#17553: du unit suggestion


From: Reuben Thomas
Subject: bug#17553: du unit suggestion
Date: Sun, 28 Apr 2024 20:09:38 +0200

On Fri, 23 May 2014 at 15:02, Reuben Thomas <rrt@sc3d.org> wrote:

> On 23 May 2014 13:12, Pádraig Brady <P@draigbrady.com> wrote:
>
>> tl;dr
>>
>>   You can get what you want currently by doing:
>>
>>     du() { env du -B1 "$@" | numfmt --to=iec-i --suffix=B; }
>>
>
> Thanks very much, that's certainly good enough for me.
>

Today I found that this doesn't cope with filenames that contain newlines,
but it's easy to fix:

du() { env du "$@" --block-size=1 --null | numfmt --zero-terminated
--from=auto --to=iec-i --suffix=B | tr '\0' '\n'; }

-- 
https://rrt.sc3d.org


reply via email to

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