Request for Comments:

I know ls already has very many options, but I find it
indispensable having the file-size field formatted with
a thousands separator (e.g. a file size of 1234567890
prints as "1,234,567,890").  I'm working with larger and
larger files all the time, and now that most OS's are
supporting 64-bit file addressing, files well over 2GB
are becoming more common.

The --human-readable option addresses this issue in a
very nice and well-implemented fashion, but I find that
my brain visually prefers comma-separated large numbers
to the --human-readable formatting style, especially in
long columns.

I downloaded the fileutils-4.0l distribution and have
made all the code changes to implement this feature.
I made the option '-K' or '--kilo-separator'.  Output
below shows what "ls -lK" looks like, with "ls -l" and
"ls -lh" for comparison.  Note that the -K option
automatically widens the file size field from 8 to 13,
which allows files up to 9,999,999,999 bytes to align
properly in columns.

Any comments or feedback?  Do you like this feature,
or find it useful?

John W. Saalwaechter
[EMAIL PROTECTED]

-----------Sample Output-----------------------------------
$ ls -lK
total 1213124
-rw-rw-r--    1 user1    user1      104,857,600 Dec 28 14:43 file1
-rw-rw-r--    1 user1    user1              124 Dec 28 14:44 file2
-rw-rw-r--    1 user1    user1           14,336 Dec 28 14:45 file3
-rw-rw-r--    1 user1    user1    1,101,004,800 Dec 28 14:49 file4
-rw-rw-r--    1 user1    user1       35,127,296 Dec 28 14:54 file5
$
$ ls -l
total 1213124
-rw-rw-r--    1 user1    user1    104857600 Dec 28 14:43 file1
-rw-rw-r--    1 user1    user1         124 Dec 28 14:44 file2
-rw-rw-r--    1 user1    user1       14336 Dec 28 14:45 file3
-rw-rw-r--    1 user1    user1    1101004800 Dec 28 14:49 file4
-rw-rw-r--    1 user1    user1    35127296 Dec 28 14:54 file5
$
$ ls -lh
total 1.2G
-rw-rw-r--    1 user1    user1        100M Dec 28 14:43 file1
-rw-rw-r--    1 user1    user1         124 Dec 28 14:44 file2
-rw-rw-r--    1 user1    user1         14k Dec 28 14:45 file3
-rw-rw-r--    1 user1    user1        1.0G Dec 28 14:49 file4
-rw-rw-r--    1 user1    user1         33M Dec 28 14:54 file5
$

Reply via email to