1) Tab completion:
A giant time saver. If you are typing a command, you need only type enough of the command to provide an initial segment that can only be extended in a single way and then can press TAB once to expand your initial segment to the entire command. So, for instance, on my system umo TAB
expands to umount
. (On my system as what initial segments are extendable only in one way is a function of what you have installed, etc.) If you do not type enough to make the completion unambiguous, TAB will not expand, but a second TAB will display a list of possible completions. So, on my system, um TAB TAB
yields:
umask umax_pp umount umount.hal
Tab completion also works on paths: cd /home/me/docs/reallylo TAB
will, if unique, expand to cd /home/me/docs/reallylongdirname
and, if not unique, offer a list of candidate continuations as with um
above.
2) man some-command
or some-command --help
or some-command -h
:
If you cannot recall how a command works, you can get documentation right there in the shell. man
usually provides the most detail. Usually one or both of the --help
and -h
arguments to a command provides a short summary.
3) head
:
man some-command
takes over the terminal and prevents you from entering commands while the man text is displayed. man some-command | head
will display the first 10 lines. man some-command | head -n
will display the first n lines. In both cases, you get your prompt back, so that you can have the man text on screen as you enter your command.