2.3. Getting Help

2.3.1. --help

Many Unix programs print out information about what they do and the command-line arguments they support when --help is supplied as a command-line argument, usually by itself.

ls --help

2.3.2. man and info

Unix systems come with a digital copy of their reference manual, which provides detailed information about the programs and features that are available. You can read the manual using man, the manual page (or man page) viewer. Here is a simplified version of the manual page for man itself:

NAME

man - an interface to the on-line reference manuals

SYNOPSIS

man [page] …

DESCRIPTION

man is the system’s manual pager. Each page argument given to man is normally the name of a program, utility command or low-level systems programming function. The manual page associated with each of these arguments is then found and displayed.

To exit man, press the q key.

A manual page for a program or system utility typically includes a SYNOPSIS section that describes how to type the command that runs the program. The following conventions apply:

  • bold text type exactly as shown.

  • italic text replace with appropriate argument.

  • [abc] any or all arguments within [ ] are optional.

  • -a | -b options delimited by | cannot be used together.

  • argument … argument is repeatable.

  • [expression] … entire expression within [ ] is repeatable.

To see the actual manual page for man, run the command below:

man man

The next example shows the command to display the manual page for ls:

man ls

If the man command does not provide you with the information that you are looking for, then odds are good that there exists an Info page for the command as well. To access the Info page for a command, enter the info command and supply the command name you want to look up as a command-line argument. To exit the Info page reader, press the q key.

info ls

Test Yourself

  • What command might you try to learn more about the command-line arguments available for the tree command?

  • What are two other ways you might get similar information using Unix commands?