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

Previous Next

Package: coreutils;

Reported by: Michal Sekletar <msekleta <at> redhat.com>

Date: Mon, 23 Jun 2014 15:37:01 UTC

Severity: normal

Tags: notabug

Merged with 18503

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 17838 in the body.
You can then email your comments to 17838 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#17838; Package coreutils. (Mon, 23 Jun 2014 15:37:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Michal Sekletar <msekleta <at> redhat.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Mon, 23 Jun 2014 15:37:02 GMT) Full text and rfc822 format available.

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

From: Michal Sekletar <msekleta <at> redhat.com>
To: bug-coreutils <at> gnu.org
Subject: ls: unit displayed for block size when if size is displayed in
 human-readable format
Date: Mon, 23 Jun 2014 13:17:09 +0200
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





Information forwarded to bug-coreutils <at> gnu.org:
bug#17838; Package coreutils. (Mon, 23 Jun 2014 16:15:02 GMT) Full text and rfc822 format available.

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

From: Pádraig Brady <P <at> draigBrady.com>
To: Michal Sekletar <msekleta <at> redhat.com>
Cc: 17838 <at> debbugs.gnu.org
Subject: Re: bug#17838: ls: unit displayed for block size when if size is
 displayed in human-readable format
Date: Mon, 23 Jun 2014 17:14:29 +0100
On 06/23/2014 12:17 PM, Michal Sekletar wrote:
> 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.

Sorry I'm not seeing the ambiguity.
What wrong with displaying 4.0K here for the disk usage, or 4M, or 512 etc?

thanks,
Pádraig.





Information forwarded to bug-coreutils <at> gnu.org:
bug#17838; Package coreutils. (Mon, 23 Jun 2014 16:48:02 GMT) Full text and rfc822 format available.

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

From: Michal Sekletar <msekleta <at> redhat.com>
To: Pádraig Brady <P <at> draigbrady.com>
Cc: 17838 <at> debbugs.gnu.org
Subject: Re: bug#17838: ls: unit displayed for block size when if size is
 displayed in human-readable format
Date: Mon, 23 Jun 2014 18:47:14 +0200
On Mon, Jun 23, 2014 at 05:14:29PM +0100, Pádraig Brady wrote:
> On 06/23/2014 12:17 PM, Michal Sekletar wrote:
> > 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.
> 
> Sorry I'm not seeing the ambiguity.
> What wrong with displaying 4.0K here for the disk usage, or 4M, or 512 etc?

From man page:

-s, --size
    print the allocated size of each file, in blocks

I assume that first column in example output should be # blocks rather than
allocated size, therefore I doubt that file which is 6 bytes in size occupies
4.0K == 4000 blocks.

> 
> thanks,
> Pádraig.

Michal

> 




Information forwarded to bug-coreutils <at> gnu.org:
bug#17838; Package coreutils. (Mon, 23 Jun 2014 16:57:01 GMT) Full text and rfc822 format available.

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

From: Pádraig Brady <P <at> draigBrady.com>
To: Michal Sekletar <msekleta <at> redhat.com>
Cc: 17838 <at> debbugs.gnu.org
Subject: Re: bug#17838: ls: unit displayed for block size when if size is
 displayed in human-readable format
Date: Mon, 23 Jun 2014 17:56:10 +0100
On 06/23/2014 05:47 PM, Michal Sekletar wrote:
> On Mon, Jun 23, 2014 at 05:14:29PM +0100, Pádraig Brady wrote:
>> On 06/23/2014 12:17 PM, Michal Sekletar wrote:
>>> 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.
>>
>> Sorry I'm not seeing the ambiguity.
>> What wrong with displaying 4.0K here for the disk usage, or 4M, or 512 etc?
> 
>>From man page:
> 
> -s, --size
>     print the allocated size of each file, in blocks
> 
> I assume that first column in example output should be # blocks rather than
> allocated size, therefore I doubt that file which is 6 bytes in size occupies
> 4.0K == 4000 blocks.

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.

thanks,
Pádraig.




Information forwarded to bug-coreutils <at> gnu.org:
bug#17838; Package coreutils. (Tue, 24 Jun 2014 08:14:01 GMT) Full text and rfc822 format available.

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

From: Michal Sekletar <msekleta <at> redhat.com>
To: Pádraig Brady <P <at> draigbrady.com>
Cc: 17838 <at> debbugs.gnu.org
Subject: Re: bug#17838: ls: unit displayed for block size when if size is
 displayed in human-readable format
Date: Tue, 24 Jun 2014 10:12:39 +0200
On Mon, Jun 23, 2014 at 05:56:10PM +0100, Pádraig Brady wrote:
> On 06/23/2014 05:47 PM, Michal Sekletar wrote:
> > On Mon, Jun 23, 2014 at 05:14:29PM +0100, Pádraig Brady wrote:
> >> On 06/23/2014 12:17 PM, Michal Sekletar wrote:
> >>> 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.
> >>
> >> Sorry I'm not seeing the ambiguity.
> >> What wrong with displaying 4.0K here for the disk usage, or 4M, or 512 etc?
> > 
> >>From man page:
> > 
> > -s, --size
> >     print the allocated size of each file, in blocks
> > 
> > I assume that first column in example output should be # blocks rather than
> > allocated size, therefore I doubt that file which is 6 bytes in size occupies
> > 4.0K == 4000 blocks.
> 
> 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!

> 
> thanks,
> Pádraig.

Michal




Reply sent to Pádraig Brady <P <at> draigBrady.com>:
You have taken responsibility. (Tue, 24 Jun 2014 09:46:02 GMT) Full text and rfc822 format available.

Notification sent to Michal Sekletar <msekleta <at> redhat.com>:
bug acknowledged by developer. (Tue, 24 Jun 2014 09:46:02 GMT) Full text and rfc822 format available.

Message #22 received at 17838-done <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Michal Sekletar <msekleta <at> redhat.com>
Cc: 17838-done <at> debbugs.gnu.org
Subject: Re: bug#17838: ls: unit displayed for block size when if size is
 displayed in human-readable format
Date: Tue, 24 Jun 2014 10:44:56 +0100
[Message part 1 (text/plain, inline)]
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.

[ls--size--help.patch (text/x-patch, attachment)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 22 Jul 2014 11:24:04 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Pádraig Brady <P <at> draigBrady.com> to control <at> debbugs.gnu.org. (Fri, 19 Sep 2014 00:46:02 GMT) Full text and rfc822 format available.

Forcibly Merged 17838 18503. Request was from Pádraig Brady <P <at> draigBrady.com> to control <at> debbugs.gnu.org. (Fri, 19 Sep 2014 00:46:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 18 Oct 2014 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 192 days ago.

Previous Next


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