Getting Help
The bash shell provides a help command that will give information about all its built-in commands. Example 4-13 shows how to get information about the alias command.
Example 4-13. Getting help for alias
$ help alias
alias: alias [-p] [name[=value] ... ]
'alias' with no arguments or with the -p option prints the list
of aliases in the form alias NAME=VALUE on standard output.
Otherwise, an alias is defined for each NAME whose VALUE is given.
A trailing space in VALUE causes the next word to be checked for
alias substitution when the alias is expanded. Alias returns
true unless a NAME is given for which no alias has been defined.If you want to get a list of commands that help can help you with, use the command by itself.
To get help about any other command in the Unix shell, use man
, the all-purpose, Swiss Army knife for getting information for most commands on the system in a form known as a manpage. For example, to see the manpage for man, type the following:
$ man manWhen you execute this command, you’ll see the output shown in Figure 4-4. Notice that there’s a colon (:) at the bottom of the window with the cursor next to it. This indicates that there’s more content to be seen in the manpage. At the prompt, you can:
Hit the spacebar or the F key to page down.
Hit the B key to go back a page.
Type a / (slash) followed by a word to search forward for that word.
Hit the Q key to quit.
When you quit out of viewing a manpage, the information goes away and you are left with the ...