Man page



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

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 documentation in other ways, sometimes in addition to man pages, sometimes in place of them. These documentation sources will be referenced, 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, the info system also provides reference documentation. The contents of the info system is sometimes the same as 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 asset 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. 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:

Several complimentary man page packs and related packages are available.

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.

Install custom man pages for local user
If user-specific man pages are required, they can be simply copied to an appropriate path, and referenced in the configuration.

Consider for example pages in (respecting the section hierarchy). Adjust the MANPATH environment variable (for bash):

Reference for  to manage the database index cache:

Recreate the database:

The custom pages should now be available with the command.

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, then. After finding the first term, type for the next occurrence.

Press for more help on viewing man pages.

Press to quit.

Sections
Manuals have different sections, for when the same 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.

When there are pages in more than one section, the sections are searched following a pre-defined order, and the first page found will be shown. For example, to show the first available page for the ebuild manual, which happens to be section 1, type:

A page from a specific section can be requested. For example, to show the ebuild page from section 5:

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

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

See for more information.

Search
To search the man page descriptions for a keyword, use:

(part of ) can also search the whatis database, for example to search for pages with "portage" in their descriptions:

Type in a terminal for more information.

sh: /usr/bin/less: No such file or directory
If the pager required by is inaccessible, a "No such file or directory" error is printed. For example, if the command is missing:

One cause of this can be being removed by. When using the  option, the   option should always be used, and the list of packages to be removed carefully reviewed.

One fix could be renstalling :

Alternatively, the PAGER or MANPAGER environment variables may be set to appropriate values. See pager section.

No manual entry for [...]
If the command reports an error beginning "No manual entry for", running  as root to initialize and manually update the index database caches may help. Gentoo performs this action daily via a cron job, this should not be impeded.

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.