Man Page

From Gentoo Linux Wiki

Jump to: navigation, search

A man page is a manual page for a Linux (or Unix) command.

Contents

[edit] Sections

Man pages are organized in sections, depending on their content. Sections are usually referenced by a number. There are 8 standard sections:

  1. User commands
  2. System calls
  3. C library functions
  4. Devices and special files
  5. File formats and conventions
  6. Games et. al.
  7. Miscellanea
  8. System administration tools and daemons

By convention, the section number is displayed in brackets after the page name, for example mount(2) is the man page for mount system calls.

[edit] Reading man pages

[edit] man

Man is the most used viewer and is installed on most Linux and Unix systems, including Gentoo. It is a command-line man page formatter and viewer, which uses the pager specified by the environment variable MANPAGER or PAGER (on Gentoo this default's to less) to display manual pages.

Command to view man page "mount" under section 2:
man 2 mount

Specifying the section is not compulsory. If no section number is specified, man will search through all the sections until it finds the manual page with the given name. Note however, that there are very likely different man pages with identical names under various sections. If no manual with the given name was found, an error message is output.

Command to view man page "mount" under any section:
man mount

Using the default pager for man (less) you can use these common keyboard commands to find your way around a manual page:

  • Page Up - Scroll up one page
  • Page Down - Scroll down one page
  • Up or Down - Scroll up or down one line
  • /pattern - Search for "pattern"
  • ?pattern - Search for "pattern" backwards
  • n - Search next (repeat previous search)
  • N - Search previous (repeat previous search backwards)
  • q - Quit

[edit] Running 'man' as root

If you get escape codes in place of formatted text when viewing a man page as root, add the following to /root/.bashrc:

File: /root/.bashrc
export LESS="-R -M --shift 5"

[edit] Konqueror

In KDE, Konqueror has support for man pages through the man protocol. This functionality is provided by the kde-base/kdebase-kioslaves package.

To read a man page in Konqueror, simply type man: followed by the name of the man page, into the address bar. For example: man:mount(2)

Personal tools