The man
utility is an interface to the local reference manuals. It is used to quickly find information on programs, utilities, functions, and other topics. The man
utility will accept several options; however, the usual invocation is simply man page
, where page actually refers to a topic. You can even run man
by itself to learn how to use it.
The following is a screenshot of the command man man
:
Running man
on a page displays that topic of interest. The spacebar is used to page down, and Q is used to quit. Pages (topics) are presented in a more or less standard order with these possible section names: NAME
, SYNOPSIS
, CONFIGURATION
, DESCRIPTION
, EXAMPLES
, OVERVIEW
, DEFAULTS
, OPTIONS
, EXIT STATUS
, RETURN VALUE
, ENVIRONMENT
, FILES
, VERSIONS
, CONFORMING TO
, NOTES
, BUGS
, AUTHORS
, HISTORY
, and SEE ALSO
.
man
shows the first page found, even if there are more pages in other sections. For example, suppose you are looking for information on how to code the readlink
function in your C program. You might try the following command:
man readlink
It brings up a page, but of the command readlink
and not the C function. Why? Because it shows the first page, unless you specify the section number before the page. Well, how do you know what that is? You can run man
with the -a
option in the following manner:
man -a readlink
This brings up the command readlink
as before. Now press Q to quit. The page goes away, but instead of terminating, the man
session shows something as follows:
Big4 /lewis/Fedora/17 # man -a readlink --Man-- next: readlink(2) [ view (return) | skip (Ctrl-D) | quit (Ctrl-C) ]
This is giving you a choice: pressing Enter will show the next page (topic), Ctrl + D will skip to the next topic, and Ctrl + C will end the man
session. Pressing Q when you are on the last topic will cause man
to terminate normally as before.
So what if you already know that you want the page from section 3 and load it directly? You can specify it in the following manner:
man 3 readlink
This will skip the first two and go right into the page for readlink
out of the POSIX Programmer's Manual.
Here is a list of the section numbers and their names:
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 (for example,
/etc/passwd
)6: Games
7: Miscellaneous (including macro packages and conventions), for example, man(7) and groff(7)
8: System administration commands
9: Kernel routines
The local reference manuals can be a great source of information. They contain a wealth of data on just about everything in a Linux system. Unfortunately, they do have some drawbacks. Most are well-written and make sense. Some are, well, rather horrible. When this happens, there are other places to find help.