GNU bug report logs - #17553
du unit suggestion

Previous Next

Package: coreutils;

Reported by: Reuben Thomas <rrt <at> sc3d.org>

Date: Thu, 22 May 2014 19:48:02 UTC

Severity: normal

Tags: notabug

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


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

From: Pádraig Brady <P <at> draigBrady.com>
To: "Linda A. Walsh" <coreutils <at> tlinx.org>
Cc: 18503 <at> debbugs.gnu.org, gemfield <gemfield <at> civilnet.cn>
Subject: Re: bug#18503: [bug-report] the output of ls -lsh
Date: Fri, 19 Sep 2014 01:05:38 +0100
unarchive 17553
forcemerge 17553 18503
stop

On 09/19/2014 12:17 AM, Linda A. Walsh wrote:
> gemfield wrote:
>>    Hi,
>>    I am running ls -lsh on kubuntu 14.04, here is the output:
>>    gemfield <at> gemfield-ThinkPad-Edge:~$ ls -ls
>>    4 -rw-rw-r-- 1 gemfield gemfield    9  9 18 23:12 test
>>    gemfield <at> gemfield-ThinkPad-Edge:~$ ls -lsh
>>    4.0K -rw-rw-r-- 1 gemfield gemfield    9  9 18 23:12 test
>>    the "4" colored by green means 4 blocks, so why becomes 4.0K blocks
>>      when add -h option to ls -ls?
>>   
> 4  * 1K blocks = 4.0K blocks.
                        ^^^^^^ -> bytes

I think the ambiguity is that there is no unit output.
With the human output options, bytes are the implicit unit rather than blocks.

The documentation on the human output options does mention that
bytes are being specified rather than blocks:
http://www.gnu.org/software/coreutils/manual/coreutils.html#Block-size

Ideally you're right that we should be outputting 4KB
or more accurately 4KiB, though due to backward compat concerns
we use the less verbose but more ambiguous format.

For more explicit conversions you can run ls through the
numfmt utility as described at http://bugs.gnu.org/17553
In fact the issues are much the same as with that bug
so I'll merge them.

thanks,
Pádraig.




This bug report was last modified 1 year and 28 days ago.

Previous Next


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