man page

From Gentoo Wiki
Jump to:navigation Jump to:search

A man page (short for manual page) is the name for software documentation found on Unix based systems. Man pages contain documentation about programs (executable files), libraries, system calls, and configuration files.

Man pages are available even when a system is not connected to the Internet. The files are usually stored in /usr/share/man but are viewed with a dedicated program, such as the man command.

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

Man pages are traditionally written in a special markup language called troff, but also can be generated from other markup languages.

Installation

Man pages should be available by default on most Gentoo installations. The sys-apps/man-db package is part of the system set and should be installed by default on Gentoo systems. The sys-apps/man-pages 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 /etc/portage/make.conf, e.g. for German:

FILE /etc/portage/make.confLocale example
LINGUAS="de"

Exclude man pages from system

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

To negate man page installation, add the following feature to /etc/portage/make.conf:

FILE /etc/portage/make.confNo man page example
FEATURES="noman"

Usage

man

Man pages can be viewed using the man command, typed in a terminal. A more thorough explanation of the man command can be found in the Navigate sub article.

man uses the default pager (typically sys-apps/less) to display man pages. The default pager can be modified using the eselect pager command.

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

To view the complete documentation for the man command:

user $man man

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:

user $man 5 ebuild

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:

user $man ebuild

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

user $man -f ebuild

Konqueror

KDE Konqueror can render man pages. Enter in the address bar man:/ followed by the man page name, e.g.: man:/ebuild. To view a specific section, add the section in parentheses, e.g.: man:/ebuild(5).

apropos

apropos (part of sys-apps/man) can search the whatis database for strings, e.g.:

user $apropos portage
color.map [color]    (5)  - custom color settings for Portage
ebuild               (1)  - a low level interface to the Portage system
...

Troubleshooting

Additional documentation

  • The man command can be used to view it's own documentation:
user $man man
  • This is also available in the info pages:
user $info man

See also