Subject: Re: bug#6381: [PATCH] Add digit grouping option for file sizes in "ls"

From: Jim Meyering <[email-masked]>
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