Subject: bug#17838: closed (Re: bug#17838: ls: unit displayed for block size when if size is displayed in human-readable format)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 24 Jun 2014 09:46:02 +0000

Your bug report

#17838: ls: unit displayed for block size when if size is displayed in human-readable format

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 [email-masked].

-- 
17838: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17838
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#17838: ls: unit displayed for block size when if size is displayed in human-readable format
From: Pádraig Brady <[email-masked]>
To: Michal Sekletar <[email-masked]>
Cc: [email-masked]
Date: Tue, 24 Jun 2014 10:44:56 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

On 06/24/2014 09:12 AM, Michal Sekletar wrote:
> On Mon, Jun 23, 2014 at 05:56:10PM +0100, Pádraig Brady wrote:
>> OK the info docs are clear enough, stating that -h is the same as
>> --block-size=human-readable etc. We might be able to tweak the
>> --help (man page) for the -s and/or -h options accordingly also.
> 
> Sorry, didn't look at info pages. In any case, tweaking man page would be very
> appreciated. Thanks!

I'll push the attached later.

thanks,
Pádraig.

>From 6635f0b0f71f68ab4e9108091bc6049ddb143648 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <[email-masked]>
Date: Tue, 24 Jun 2014 10:33:41 +0100
Subject: [PATCH] doc: state in ls --help, that -h affects --size format

* src/ls.c (usage): State that --human changes --size format.
Fixes http://bugs.gnu.org/17838
---
 src/ls.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/ls.c b/src/ls.c
index 25e10fa..54c6705 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -4828,7 +4828,7 @@ Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.\n\
 "), stdout);
       fputs (_("\
   -G, --no-group             in a long listing, don't print group names\n\
-  -h, --human-readable       with -l, print sizes in human readable format\n\
+  -h, --human-readable       with -l and/or -s, print human readable sizes\n\
                                (e.g., 1K 234M 2G)\n\
       --si                   likewise, but use powers of 1000 not 1024\n\
 "), stdout);
-- 
1.7.7.6

Subject: ls: unit displayed for block size when if size is displayed in human-readable format
From: Michal Sekletar <[email-masked]>
To: [email-masked]
Date: Mon, 23 Jun 2014 13:17:09 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

ls utility currently displays suffix representing unit in blocks column if
--size is combined with --human-readable. For example:

$ ls -l -sh /tmp/foo
4.0K -rw-r--r--. 1 root root 6 Jun 23 11:32 foo

Suffix K in the output shown doesn't seem correct and implies false information.
Moreover if size of file is bigger say 1M then suffix used for blocks column
would be M. Looks like if file is small enough and no suffix is shown in size
column then suffix K is implied for # blocks column.

$ rpm -q coreutils
coreutils-8.22-14.fc21.x86_64

I contacted downstream maintainer first and this behavior shouldn't be caused by
downstream patch, therefore reporting here.

Please disregard this report if this is expected or bug is already reported.

Thanks,

Michal