Getting help

Unix provides a help system/command called man, short for manual. The man help system has a large set of manual pages on various topics, such as commands, program library functions, file structures, etc. These have been grouped into general categories.

       0   Header files (usually found in /usr/include)
       1   Executable programs or shell commands
       2   System calls (functions provided by the kernel)
       3   Library calls (functions within program libraries)
       4   Special files (usually found in /dev)
       5   File formats and conventions eg /etc/passwd
       6   Games
       7   Miscellaneous (including  macro packages and conventions)
       8   System administration commands (usually only for root)
       9   Kernel routines [Non standard]
Overall, this list applies to all Unix systems, but you may find some variation on different versions of Unix. For example, the Solaris system has the separate sections 1m for maintenance commands, 1b for Berkeley versions of some commands, and 1p for posix standard commands.

To view a particular topic, invoke man followed by the command or topic to be studied. If one or more man pages for that topic exists, the first and only the first one will be displayed. Because these manual pages can be 100's of lines long, man will use a viewing program specified by the environmental variable PAGER. In most cases, this will be less.

To see which man pages are available for a topic, use -f option. For example :

man -f man

If you wish to view all manual pages for a topic, invoke man with the -a option. The first man page will be displayed. Use :n to go to the next page and :p to move to a previous man page. Use q to quit the less viewer.

To view a particular man page, use the -S[section] option. For example, the previous man -f man should have listed 3 pages 1, 1p, and 7. To view the posix page (1p), try :

man -S1p man

You may find that the exact option syntax for retrieving specific man pages varies on different versions of Unix.

In cases where there is not a specific man page for a topic, you can use the -k (keyword) option. The keyword option will list all man pages that deal with the keyword. This match will be very general and may reference many man pages that are of no interest. The list may run several screens, so you may want to pipe the output to less.

man -k man | less

The man has a general structure with several sections. Not all sections may apply for a particular topic.

Possible sections :

NAME - name of the topic covered in the man page and a short description of the topic.

SYNOPSIS - most often exists if the topic covers a command. It will contain a listing of the command and all the available options or variations of the command.

DESCRIPTION - is a detailed description of the topic.

OPTIONS - is a detail description of the available options and their effects. In some cases, DESCRIPTION and OPTIONS are a single section.

FILES - lists files associated with the topic. For example, the passwd page lists the passwd data file and the shadow data file as related files.

SEE ALSO - lists other topics related to the current one.

There may be several other sections, including AUTHOR, BUGS, and EXAMPLES.

The man command is the original help system developed as part of the Unix system. But with the development of the GNU collection of commands, a second help system, info, has been developed. In general, you will find basic Unix commands are better documented in man, but newer GNU commands or commands that have been tuned for Linux are better documented in info. If you are looking for more than just basic information, always take a peak at the topic in both help systems.

info - The other help system
Overview