Man page



The page system (short for manual page) Article description::contains system reference documentation, and is found on most Unix-like systems. Man pages contain documentation about programs (executable files), libraries, system calls, and configuration files.

This article presents documentation for the use of the man page system on Gentoo. For many pieces of software, the man pages will contain the canonical documentation, as set out by the projects authors, maintainers, and documentation writers. Many software projects provide comprehensive documentation in different ways, and this will be referenced from the wiki where appropriate.

Man pages are available even when a system is not connected to the Internet. The files are usually stored in but are viewed with a dedicated program, such as the  command. Man pages are traditionally written in a special markup language called troff, but can be generated from other markup languages.

In parallel to man pages is the info system. The contents of the info system is sometimes the same as in the man pages, sometimes it will be complimentary, sometimes only one system will contain anything at all. Man pages tend to be monolithic documents whereas info pages are hyperlinked.

It is a real advantage to have documentation present on a system in a standardized and accessible way. Getting into the habit of looking for answers in the man and info pages is very good practice, they often contain the most complete documentation available.

Installation
Man pages should be available by default on most Gentoo installations. The package is part of the system set and should be installed by default on Gentoo systems. The package provides many basic man pages and is also part of the system set.

Localization
If localized man pages are desired, set the LINGUAS variable in, e.g. for Italian:

Pager
The command uses an external program, called a pager, to display the man pages. will first use the PAGER environment variable (default, from ) to determine what pager to use. To use a different pager, the MANPAGER environment variable can be set. See for details on how  chooses the pager. See recommended tools for suggestions of pagers available on Gentoo. See the Handbook on how to set environment variables.

The default pager can be modified using the eselect command. See for details.

Being able to choose the program that will display man pages gives quite some flexibility to the man system. In addition to pagers in general, even vim can be used to display man pages - for example, for a user running bash:

Color for man pages
Man pages can be viewed in color by setting up the pager to use color.

To use to color the display or man pages, set the MANPAGER environment variable accordingly. For example, for a user running bash:

The pager  can also be used for a pleasing color output. For example:

See the Handbook on how to set environment variables.

Man pages on constrained systems
Most packages install additional man pages. This can be avoided to save small amounts of disk space, for creating embedded systems, for example. This saves very little space, and is meant for extremely constrained environments only.

It is useful to have the man pages installed, they should be omitted only if absolutely necessary.

To negate man page installation, add the following feature to :

Invocation
Man pages can be viewed using the command, typed in a terminal. For example, to view the man page on Portage for the command:

Options:

A more thorough explanation of the command can be found in the Navigate sub article.

Viewing a man page
Presuming, or similar, is used as the pager, navigation of a man page can be performed using the and  arrow keys (or the  and  keys if Vim navigation is preferred). Scroll page wise with the and  keys. Search using the key followed by the search term.

Use the key to search for text when viewing a man page. After finding the first term, type for the next occurrence.

Press for more help on viewing man pages.

Press to quit.

Sections
Man pages have different sections, for when same a term is used in different domains. The sections are numbered : 1 general commands, 2 system calls, 3 library functions, 4 special files and drivers, 5 file formats and conventions, 6 games and screensavers, 7 miscellaneous, 8 system administration commands and daemons.

For example, to show the ebuild man page of section 5:

When there is more than one man page with same name, the first found will be shown. To show the ebuild man page of section 1:

To list available sections for a given term, use the  option:

Command descriptions
If all that is needed is to know what a command is, a one line description can be shown with the command (part of ):

Type in a terminal for more information.

Search
To search the man page descriptions for a keyword:

This can also be done with the apropos command, see appropriate section.

(part of ) can also search the whatis database:

Type in a terminal for more information.

Troubleshooting

 * Man says no such file or directory for less
 * No manual entry for java-config

Additional documentation

 * The command can be used to view it's own documentation: type  in a terminal for more information.
 * This is also available in the info pages:.

Additional tools

 * emacs should be able to be set up to view man pages.
 * KDE Konqueror can render man pages. Enter in the address bar   followed by the man page name, e.g.:  . To view a specific section, add the section in parentheses, e.g.:  .
 * KHelpCenter KDE documentation viewer.
 * Yelp GNOME documentation viewer.