GNU bug report logs - #6381
[PATCH] Add digit grouping option for file sizes in "ls"

Previous Next

Package: coreutils;

Reported by: Sam Bobroff <samb <at> firx.net>

Date: Wed, 9 Jun 2010 06:17:02 UTC

Severity: wishlist

Tags: moreinfo, patch

Done: Bob Proulx <bob <at> proulx.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 6381 in the body.
You can then email your comments to 6381 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 owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#6381; Package coreutils. (Wed, 09 Jun 2010 06:17:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sam Bobroff <samb <at> firx.net>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Wed, 09 Jun 2010 06:17:02 GMT) Full text and rfc822 format available.

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

From: Sam Bobroff <samb <at> firx.net>
To: bug-coreutils <at> gnu.org
Subject: [PATCH] Add digit grouping option for file sizes in "ls"
Date: Wed, 09 Jun 2010 14:05:29 +1000
[Message part 1 (text/plain, inline)]
Hello,

Please excuse me if I'm not going about this the right way but I would
like to offer a tiny patch for "ls" that adds an option to turn on digit
grouping for file sizes in the long output format.

(The support for displaying digit grouping is already present, all that
is required is an option for turning it on.)

I find it a very nice way to view file sizes because it makes it easy to
read the size of large files (like -h) but it does not hide any
information (unlike -h).

For example:

$ ls -l bigfile
-rw-r--r-- 1 samb samb 2146034154 2010-06-08 14:55 big.log

$ ls -ly bigfile
-rw-r--r-- 1 samb samb 2,146,034,154 2010-06-08 14:55 big.log

(The patch is against the latest git checkout but I have only actually
compiled it against the latest .tar release due to dependencies.)

Peace out,
Sam Bobroff.
[ls.diff (text/plain, attachment)]

Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#6381; Package coreutils. (Wed, 09 Jun 2010 07:37:02 GMT) Full text and rfc822 format available.

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

From: Jim Meyering <jim <at> meyering.net>
To: Sam Bobroff <samb <at> firx.net>
Cc: 6381 <at> debbugs.gnu.org
Subject: Re: bug#6381: [PATCH] Add digit grouping option for file sizes in "ls"
Date: Wed, 09 Jun 2010 09:36:35 +0200
Sam Bobroff wrote:
> Please excuse me if I'm not going about this the right way but I would
> like to offer a tiny patch for "ls" that adds an option to turn on digit
> grouping for file sizes in the long output format.
>
> (The support for displaying digit grouping is already present, all that
> is required is an option for turning it on.)
>
> I find it a very nice way to view file sizes because it makes it easy to
> read the size of large files (like -h) but it does not hide any
> information (unlike -h).
>
> For example:
>
> $ ls -l bigfile
> -rw-r--r-- 1 samb samb 2146034154 2010-06-08 14:55 big.log
>
> $ ls -ly bigfile
> -rw-r--r-- 1 samb samb 2,146,034,154 2010-06-08 14:55 big.log

Thanks, but you can do that already.
Use --block-size="'1" and be sure you're using a locale
that uses the thousands-grouping byte you're used to:

    $ dd if=/dev/zero of=big bs=1k count=1 seek=1G
    ...
    $ LC_ALL=en_US ls -lgo --block-size="'1" big
    -rw-------. 1 1,099,511,628,800 2010-06-09 09:32 big




Severity set to 'wishlist' from 'normal' Request was from Bob Proulx <bob <at> proulx.com> to control <at> debbugs.gnu.org. (Wed, 09 Jun 2010 16:27:01 GMT) Full text and rfc822 format available.

Added tag(s) moreinfo. Request was from Bob Proulx <bob <at> proulx.com> to control <at> debbugs.gnu.org. (Wed, 09 Jun 2010 18:50:02 GMT) Full text and rfc822 format available.

Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#6381; Package coreutils. (Thu, 10 Jun 2010 09:38:01 GMT) Full text and rfc822 format available.

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

From: Sam Bobroff <samb <at> firx.net>
To: bug-coreutils <at> gnu.org
Subject: Re: bug#6381: [PATCH] Add digit grouping option for file sizes in "ls"
Date: Thu, 10 Jun 2010 19:37:17 +1000
On 9/06/10 5:36 PM, Jim Meyering wrote:
> Sam Bobroff wrote:
>> Please excuse me if I'm not going about this the right way but I would
>> like to offer a tiny patch for "ls" that adds an option to turn on digit
>> grouping for file sizes in the long output format.
>>
>> (The support for displaying digit grouping is already present, all that
>> is required is an option for turning it on.)
>>
>> I find it a very nice way to view file sizes because it makes it easy to
>> read the size of large files (like -h) but it does not hide any
>> information (unlike -h).
>>
>> For example:
>>
>> $ ls -l bigfile
>> -rw-r--r-- 1 samb samb 2146034154 2010-06-08 14:55 big.log
>>
>> $ ls -ly bigfile
>> -rw-r--r-- 1 samb samb 2,146,034,154 2010-06-08 14:55 big.log
> 
> Thanks, but you can do that already.
> Use --block-size="'1" and be sure you're using a locale
> that uses the thousands-grouping byte you're used to:
> 
>     $ dd if=/dev/zero of=big bs=1k count=1 seek=1G
>     ...
>     $ LC_ALL=en_US ls -lgo --block-size="'1" big
>     -rw-------. 1 1,099,511,628,800 2010-06-09 09:32 big

Oh! How embarrassing. I'd very carefully read the man page looking for
this but I never thought it would only be documented in the info pages
(yes, even though the man page states that the full documentation is in
the info pages). Well, we live and learn.

It's great that it already has this feature :-)

Thanks,
Sam.





Reply sent to Bob Proulx <bob <at> proulx.com>:
You have taken responsibility. (Fri, 11 Jun 2010 01:10:03 GMT) Full text and rfc822 format available.

Notification sent to Sam Bobroff <samb <at> firx.net>:
bug acknowledged by developer. (Fri, 11 Jun 2010 01:10:03 GMT) Full text and rfc822 format available.

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

From: Bob Proulx <bob <at> proulx.com>
To: Sam Bobroff <samb <at> firx.net>
Cc: 6381-done <at> debbugs.gnu.org
Subject: Re: bug#6381: [PATCH] Add digit grouping option for file sizes in "ls"
Date: Thu, 10 Jun 2010 19:09:45 -0600
Sam Bobroff wrote:
> Oh! How embarrassing. I'd very carefully read the man page looking for
> this but I never thought it would only be documented in the info pages
> (yes, even though the man page states that the full documentation is in
> the info pages). Well, we live and learn.
>
> It's great that it already has this feature :-)

Those are the easiest bugs to fix!  :-)

And so I am going to mark the bug as done and close it with this
message.

Bob




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

From: Sam Bobroff <samb <at> firx.net>
To: Bob Proulx <bob <at> proulx.com>
Cc: 6381-done <at> debbugs.gnu.org
Subject: Re: bug#6381: [PATCH] Add digit grouping option for file sizes in "ls"
Date: Fri, 11 Jun 2010 12:07:15 +1000
On 11/06/10 11:09 AM, Bob Proulx wrote:
> Sam Bobroff wrote:
>> Oh! How embarrassing. I'd very carefully read the man page looking for
>> this but I never thought it would only be documented in the info pages
>> (yes, even though the man page states that the full documentation is in
>> the info pages). Well, we live and learn.
>>
>> It's great that it already has this feature :-)
> 
> Those are the easiest bugs to fix!  :-)
> 
> And so I am going to mark the bug as done and close it with this
> message.
> 
> Bob

OK. Although while we're on the topic... after pondering this for a
while I think that it would still be nice to have a simple, separate,
argument to turn on digit grouping for a few reasons:

* Turning it on via block-size is a bit hard to type, but it could be
something that you use often (like -h).
* As a separate option it could easily be explained in the man page so
more people could find it.
* The current method encodes two options into one option, which seems
clumsy and causes it to interact with the other short-cuts: "ls
--block-size=\'1 -k" does not turn on grouping.
* And, there is already a precedent for short-cuts in this area: -s, -h,
--si and -k.

I do realise that "ls" already has so many options that it's running out
of letters, so that may be a good reason not to add one for this ;-)

Also, it seems like setting LS_BLOCK_SIZE in your environment is a
pretty good way of avoiding having to type it out, if you want it on all
the time and aren't concerned that it will be turned off by -si or -k.

Just putting in my $0.02 while I have the chance :-)

Cheers,
Sam.




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

This bug report was last modified 15 years and 44 days ago.

Previous Next


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