GNU bug report logs -
#14525
ls -k produced no size, ls -lk lists in bytes? What's up w/k?
Previous Next
Reported by: Linda Walsh <coreutils <at> tlinx.org>
Date: Sat, 1 Jun 2013 01:05:01 UTC
Severity: normal
Tags: notabug
Done: Assaf Gordon <assafgordon <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
On 06/01/2013 03:54 PM, Linda Walsh wrote:
> I know the "-h" displays sizes using variable units,
> but if I want to have it display all of the sizes in terms
> of 'K' or 'M' or (not likely useful, but 'G' or 'T'), how
> do I do it?
'ls --block-size=1k' or 'ls --block-size=1M'
> If 'k' doesn't have it, does posix mandate that the user can't
> choose what unit to display things in?
POSIX can only mandate what portable uses are limited to. You are
correct that there is no portable way, via POSIX options alone, to make
ls change what units it displays in, other than what POSIX requires of
'-k' (which affects only the -s column and the per-directory summary).
But POSIX does not (and cannot) mandate against extensions, and we have
not removed any of coreutils' extensions - we merely removed -k as a
synonym of the extension --block-size=..., because the POSIX
specification of -k is incompatible with the --block-size= extension
semantics that we did not change. If you think there is an extension
missing in ls to display something that you need, feel free to write a
patch to provide that extension - we have long desired to have a
--format option that would let you choose which pieces of information to
display and in what order.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[signature.asc (application/pgp-signature, attachment)]
This bug report was last modified 6 years and 215 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.