man page

man pages—abbreviation for "manual pages"—are the form of documentation that is available on almost all UNIX-like operating systems, including Arch Linux. The command used to display them is man.

In spite of their scope, man pages are designed to be self-contained documents, consequentially limiting themselves to referring to other man pages when discussing related subjects. This is in sharp contrast with the hyperlink-aware Info documents, GNU's attempt at replacing the traditional man page format.

Installation

man-db implements man on Arch Linux, and less is the default pager used with man. mandoc can also be used.

man-pages provides both the Linux and the POSIX.1 man pages (see ).

Some localized man pages are also available:

You can also search for all of the available localized man pages on the official repositories and on the AUR.

You can use some applications to view man pages:

Accessing man pages

To read a man page, simply enter:

$ man page_name

Manuals are sorted into several sections. Each section has an intro, such as , intro(2) and so on. For a full listing see .

Man pages are usually referred to by their name, followed by their section number in parentheses. Often there are multiple man pages of the same name, such as and . In this case, give man the section number followed by the name of the man page, for example:

$ man 5 passwd

to read the man page on /etc/passwd, rather than the utility.

Or equivalently, the man page followed by the section number, separated by a period:

$ man passwd.5

Searching manuals

Man pages can be searched when the exact name of a page is not known using any of the following equivalent commands:

$ man -k expression
$ man --apropos expression
$ apropos expression
is interpreted as a regular expression by default.

To search for keywords in whole page texts, use the option instead.

One-line descriptions of man pages can be displayed using the command. For example, for a brief description of the man page sections about ls, type:

Page width

The man page width is controlled by the environment variable.

If the number of columns in the terminal is too small (e.g. the window width is narrow), the line breaks will be wrong. This can be very disturbing for reading. You can fix this by setting the MANWIDTH on man invocation. With , that would be:

Reading local man pages

Instead of the standard interface, using browsers such as and Firefox to view man pages allows users to reap info pages' main benefit of hyperlinked text. Alternatives include the following:

mandoc

Install the mandoc package. To convert a page, for example :

$ mandoc -Thtml -Ostyle=style.css /usr/share/man/man1/free.1.gz > free.html

Now open the file called free.html in your favourite browser.

man2html

First, install from the official repositories.

Now, convert a man page:

$ man free | man2html -compress -cgiurl man$section/$title.$section$subsection.html > ~/man/free.html

Another use for is exporting to raw, printer-friendly text:

$ man free | man2html -bare > ~/free.txt

man -H

The man-db implementation also has the ability to do this on its own:

$ man -H free

This will read your BROWSER environment variable to determine the browser. You can override this by passing the binary to the option.

roffit

First install from AUR.

To convert a man page:

$ gunzip -c /usr/share/man/man1/free.1.gz | roffit > free.html

Conversion to PDF

man pages have always been printable: they are written in , which is fundamentally a typesetting language. Therefore, you can easily convert man pages to any of the formats supported as output devices by groff, which is used by . For a list of output devices, see the option in (or mandoc(1) if you use the mandoc package).

This will produce a PDF file:

$ man -Tpdf manpage > filename

Caveats: Fonts are generally limited to Times at hardcoded sizes. Some man pages were specifically designed for terminal viewing, and will not look right in PS or PDF form.

Online man pages

There are several online databases of man pages, including:

Note that while provides man pages for POSIX.1 (see ), an official online reference also exists:

There is also a comparison table of the online databases.

Warning: Some distributions provide patched or outdated man pages that differ from those provided by Arch. Exercise caution when using online man pages.

Noteworthy man pages

Here follows a non-exhaustive list of noteworthy pages that might help you understand a lot of things more in-depth. Some of them might serve as a good reference (like the ASCII table).

More generally, have a look at category 7 (miscellaneous) pages:

$ man -s 7 -k ".*" 

Arch Linux specific pages:

gollark: Or pointers.
gollark: r/idonotknowreferences
gollark: *suddenly notices that a random AP egg he picked up is `orW1N`*
gollark: ||s||||p||||o||||i||||l||||e||||r||||s|||| ||||a||||r||||e|||| ||||f||||u||||n||||!||
gollark: Why the ||spoilers||?

See also

This article is issued from Archlinux. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.