I am curious to know what trick you use to remember options for various commands? Looking up man pages all the time is time consuming and not so cool!
The trick is simple: You just don't. It's a waste of time and just not necessary. Memorizing command options isn't a particularly useful skill. It's much more important to understand how stuff works in general and to have a vague idea which tools exist in the first place and what you use them for. A very important skill here is to know how to find out about stuff you don't know yet. Man pages are time consuming? Not so. It's not like you have to read them - at least, not every time - there is a search function. So if I don't remember which cryptic option was the one for Imagine someone actually memorizing all of the It's fine if you just happen to remember options because you use them frequently. That happens automatically without even thinking about it. But actually consciously spending time on memorizing them... what's that supposed to be good for? A paper test? |
|||||||||
|
Zsh has the run-help function, by default bound to Alth. With this function you can begin typing a command with many or complex options that are difficult to remember, like
read the
As the wiki notes: The function can be further customized by defining helper functions of the form run-help-command. There are three such functions available in the standard distribution: run-help-git, run-help-svk, and run-help-svn. |
|||||||||||||
|
Most commands have --help for quick reference, and it is usually enough to remind what was something that I used to know. That said have a habit of writing --help instead of -h or even -?. You never know what -h is before looking usage output or manual page. In worst case the -h might be short hand for --hazardous-automatic-destruction. |
|||||||||||||
|
Using a very long command history, and seaching through it, is very useful. I basically collect all shell history files, and grep through them. The results found are in many cases very useful, as it's easy to seach for good keywords. |
|||
|
I typically do:
Or some variation thereof. With some
The same techniques work with Anyway, I guess the moral of the story is, remember at least |
|||||
|
One option I like is to create aliases that have the same or similar options, e.g.
This way you have a nice shortcut that you'll soon remember easily but that will also retain information about the actual option(s) it reflects. Another approach with aliases is to pick the most common options and make a super short alias that uses them. For instance for
Another option is to just bring in the the options you like to the base command, e.g.
Finally practice, practice, practice and patience. Keep typing common options and you will eventually learn them. The common ones in days, others in weeks and yes some take years to become known to you. Think of that as a treat in that unix programming will continue to entertain you for a long time. Another option that I like is an alias to make searching my history easier and for that I have two similar aliases:
These let me search for uses of a command for instance:
I developed hg after finding that hga tended to show too much. |
|||||
|
zsh
. – Stéphane Chazelas yesterdayman
pages is very cool... :) – jasonwryan 23 hours ago