GNU bug report logs - #8676
ls --si --human-readable, MB vs M

Previous Next

Package: coreutils;

Reported by: Peggy Russell <prusselltechgroup <at> gmail.com>

Date: Mon, 16 May 2011 16:15:02 UTC

Severity: normal

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Peggy Russell <prusselltechgroup <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: ls --si --human-readable, MB vs M
Date: Mon, 16 May 2011 03:48:40 -0500
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 305 days ago.

Previous Next


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