[TUHS] Command line options and complexity
Greg 'groggy' Lehey
grog at lemis.com
Thu Mar 12 08:56:38 AEST 2020
On Wednesday, 11 March 2020 at 14:18:08 +1100, Dave Horsfall wrote:
> The "ls" command for example really needs an option-ectomy; I find that I
> don't really care about the exact number of bytes there are in a file as
> the nearest KiB or MiB (or even GiB) is usually good enough, so I'd be
> happy if "-h" was the default with some way to turn it off (yes, I know
> that it's occasionally useful to add them all up in a column, but that
> won't tell you how many media blocks are required).
A good example. But you're not removing options, you're just
redefining them. In fact I find the -h option particularly emetic, so
a better choice in removing options would be to remove -h and use a
filter to mutilate the sizes:
$ ls -l | humanize
But that's a pain, isn't it? That's why there's a -h option for
people who like it. Note that you can't do it the other way round:
you can't get the exact size from -h output.
And then there's the question why you don't like the standard output.
Because the number strings are too long and difficult to read, maybe?
That's the rationale for the -, option.
> Quickly now, without looking: which option shows unprintable
> characters in a filename? Unless you use it regularly (in which
> case you have real problems) you would have to look it up; I find
> that "ls ... | od -bc" to be quicker, especially on filenames with
> trailing blanks etc (which "-B" won't show).
This is arguably a bug in the -B option. I certainly don't think the
pipe notation is quicker. But it's nice to have both alternatives.
Sent from my desktop computer.
Finger grog at lemis.com for PGP public key.
See complete headers for address and phone numbers.
This message is digitally signed. If your Microsoft mail program
reports problems, please read http://lemis.com/broken-MUA
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 163 bytes
Desc: not available
More information about the TUHS