Commands with options: (was: war story: parallel(1) command)
David Thornton
northdot9-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Mon Jul 29 12:08:58 UTC 2013
I use 'ls -la'
Stuff that starts with a 'd' sticks out well enough that I don't need
anything more.
However a simple '| grep ^d' will give you just the directories.
Or use find
find . -type d
David Thornton
On 7/28/13, phiscock-g851W1bGYuGnS0EtXVNi6w at public.gmane.org <phiscock-g851W1bGYuGnS0EtXVNi6w at public.gmane.org> wrote:
>
>> I hate it that there are so many flags on so many commands.
>> <http://harmful.cat-v.org/cat-v/>
>
> Interesting read. Unfortunately, the concept of 'lots of small tools that
> do one job well' instead of 'zillions of options' leads to two
> alternatives:
>
> 1. Concatenate a series of small programs or shell script symbols to do
> the job you want, or
>
> 2. Hide that construction in an alias.
>
> The disadvantage of 1 is that the incantation is often hard to remember.
> My (un)favourite example: the ls command has no option to display only
> directories. Yes, there are alternatives, but should you have to commit
> something like this to memory: 'ls -p |grep /' ? Surely something like ls
> -D would be easier to remember.
>
> How about ls -d */ ?
>
> That's much easier to remember, but my understanding is that only works in
> bash.
>
> The disadvantage of 2 is that aliases are non-standard. If you re-install
> the system, you have to re-install all your aliases. If they are commands,
> they should be included in the operating system. Otherwise, no one else
> (human or machine) recognizes your aliases.
>
> Incidentally, it is interesting to see that the man page for cat actually
> has examples, something that many man pages could benefit from.
> Unfortunately, the cat command has accumulated 10 options, only two of
> which have examples.
>
> My solution to this is a correction of hints, which contain these
> commands. Many have been contributed by members of TLUG, thank-you. But
> that requires looking them up each time.
>
> Incidentally, for me the most useable solution for identifying directories
> has been
> ls -colour | more.
> The directories are a different colour. However, I suspect that's not
> totally portable either.
>
>
> Peter
>
>
>
> --
> Peter Hiscocks
> Syscomp Electronic Design Limited, Toronto
> http://www.syscompdesign.com
> USB Oscilloscope and Waveform Generator
> 647-839-0325
>
> --
> The Toronto Linux Users Group. Meetings: http://gtalug.org/
> TLUG requests: Linux topics, No HTML, wrap text below 80 columns
> How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists
>
--
Sent from my mobile device
--
The Toronto Linux Users Group. Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists
More information about the Legacy
mailing list