GNU bug report logs -
#8676
ls --si --human-readable, MB vs M
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#8676: ls --si --human-readable, MB vs M
which was filed against the coreutils package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 8676 <at> debbugs.gnu.org.
--
8676: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8676
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
tags 8676 + notabug
thanks
Paul Eggert wrote:
> On 05/16/11 01:48, Peggy Russell wrote:
>> Shouldn't the `ls -l --si` output (#2 or #4) be display as 60MB vs 60M
>
> That would be more consistent, yes. But it would also take up an extra
> column of output, and those columns are precious.
Just marking this issue as "done".
[Message part 3 (message/rfc822, inline)]
Hi,
From: man:ls
............................................................................
SIZE may be (or may be an integer optionally followed by) one of following:
kB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y.
............................................................................
From: info:/coreutils/Block size
............................................................................
...
With human-readable formats, output sizes are followed by a size letter such
as `M' for megabytes. `BLOCK_SIZE=human-readable' uses powers of 1024; `M'
stands for 1,048,576 bytes. `BLOCK_SIZE=si' is similar, but uses powers of
1000 and appends `B'; `MB' stands for 1,000,000 bytes.
...
`MB'
megabyte: 10^6 = 1,000,000.
`M'
`MiB'
mebibyte: 2^20 = 1,048,576.
............................................................................
Commands:
............................................................................
#1 ls -l file.ogg
-r--r--r-- 1 user group 59802045 2010-07-01 20:37 file.ogg
#2 ls -l --si file.ogg
-r--r--r-- 1 user group 60M 2010-07-01 20:37 file.ogg
#3 ls -l --human-readable file.ogg
-r--r--r-- 1 user group 58M 2010-07-01 20:37 file.ogg
#4 ls -l --block-size=si file.ogg
-r--r--r-- 1 user group 60M 2010-07-01 20:37 file.ogg
#5 ls -l --block-size=human-readable file.ogg
r--r--r-- 1 user group 58M 2010-07-01 20:37 file.ogg
............................................................................
Given the above:
SI Decimal (Matches #2):
59802045/(1000*1000) = roundup(59.80,0) = 60 MB
IEC Binary (Matches #3):
59802045/(1024*1024) = roundup(57.03,0) = 58 M
Shouldn't the `ls -l --si` output (#2 or #4) be display as 60MB vs 60M or
am I just missing a `ls` option for formatting the different display units?
Thank you.
Peggy Russell
This bug report was last modified 13 years and 304 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.