GNU bug report logs - #20442
bug+patch: du output misaligned on different terminals

Previous Next

Package: coreutils;

Reported by: "L. A. Walsh" <coreutils <at> tlinx.org>

Date: Mon, 27 Apr 2015 19:12:01 UTC

Severity: normal

Tags: wontfix

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Pádraig Brady <P <at> draigBrady.com>
To: Linda Walsh <coreutils <at> tlinx.org>, 20442 <at> debbugs.gnu.org
Subject: bug#20442: bug+patch: du output misaligned on different terminals
Date: Tue, 28 Apr 2015 01:28:47 +0100
On 28/04/15 01:13, Linda Walsh wrote:
> reopen 20442
> thanks
> =======
> 
> Your more general case doesn't work:
> 
>> du -sh /tmp/t*|numfmt --format %10f
> numfmt: rejecting suffix in input: ‘4.0K’ (consider using --from)
>> du -sh --time /tmp/t*|numfmt --format %10f
> numfmt: rejecting suffix in input: ‘4.0K’ (consider using --from)

You can use:

  du -h --time | numfmt --from=iec --to=iec --format %10f

Though more naturally you can use:

  du -B1 --time | numfmt --to=iec --format %10f

Since these are formatting for human consumption,
there are varying preferences etc, and so
(variants of) the above are appropriate for aliases,
or shell functions if accepting parameters.

> I usually use other arguments with 'du'.  Your external tool solution
> doesn't handle the general case of "du's" output.
> 
> The point was to correct 'du's output, not find a *custom* solution
> to correct assumptions made by 'du'.
> 
> Why would you reject something that fixes this problem?

There are backwards compatibility issues to consider.

cheers,
Pádraig.




This bug report was last modified 6 years and 297 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.