GNU bug report logs -
#50940
how df utility displays sizes - GB vs GiB
Previous Next
Full log
Message #8 received at 50940 <at> debbugs.gnu.org (full text, mbox):
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.