GNU bug report logs - #50940
how df utility displays sizes - GB vs GiB

Previous Next

Package: coreutils;

Reported by: Danie de Jager <danie.dejager <at> gmail.com>

Date: Fri, 1 Oct 2021 15:02:02 UTC

Severity: wishlist

Full log


View this message in rfc822 format

From: Pádraig Brady <P <at> draigBrady.com>
To: Danie de Jager <danie.dejager <at> gmail.com>, 50940 <at> debbugs.gnu.org
Subject: bug#50940: how df utility displays sizes - GB vs GiB
Date: Fri, 1 Oct 2021 17:18:04 +0100
On 01/10/2021 14:28, Danie de Jager wrote:
> Hi,
> 
> The output from df -h and df -H is always G or M. Depending on who sends me
> usage stats I have to ask how the command was run to make sure I calculate
> usage correctly. Systems like Amazon EC2 use the explicit GiB suffix.
> Making it easier to know what sizes you are looking at.
> 
> Can a future release of df not be improved to print out the GB or GiB?

So you're suggesting that `df -h` changes to using IEC suffixes like Gi, Ti etc.
and -H would use the current suffix format to indicate SI units.
That would be the right thing to do if we were adding these options now,
but at this stage I'm not sure it's worth it, because you wouldn't
be sure which version of df you were getting the output from.

For completeness one can get unambiguous output using numfmt like:

  $ df -B1 | numfmt --field - --invalid=ignore --to=iec-i
  Filesystem        1B-blocks        Used  Available Use% Mounted on
  devtmpfs              3.9Gi           0      3.9Gi   0% /dev

cheers,
Pádraig




This bug report was last modified 3 years and 204 days ago.

Previous Next


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