Man pages (short for manual pages) are the extensive documentation that comes preinstalled with almost all substantial Unix and Unix-like operating systems. The Unix command used to display them is
man. Each page is a self-contained document.
To read a manual page for a Unix command, one can use
at a shell prompt: for example, "man ftp". In order to simplify navigation through the output, man generally uses the less terminal pager.
Pages are traditionally referred to using the notation "name(section)": for example,
ftp(1). The same page name may appear in more than one section of the manual, as when the names of system calls, user commands, or macro packages coincide. Examples are
exit(3). The syntax for accessing the non-default manual section varies between different man implementations. On Linux and *BSD, for example, the syntax for reading
which searches for printf in section 3 of the man pages.
To quit and go back to the terminal session type "q" without the quotation marks.
The UNIX Programmer's Manual was first published on November 3, 1971. The first actual man pages were written by Dennis Ritchie and Ken Thompson at the insistence of Doug McIlroy in 1971. The troff macros used for man pages (-mm) were the general-purpose ones written by Ted Dolotta (later to be the first manager of USG and the principal author of the System III manual), with additions for the manuals. At the time, the availability of online documentation through the manual page system was regarded as a great advance. To this day, virtually every Unix command line application comes with its man page, and many Unix users perceive a lack of man pages as a sign of low quality; indeed, some projects, such as Debian, go out of their way to write man pages for programs lacking one. Few alternatives to
man have enjoyed much popularity, with the possible exception of GNU Project's "
info" system, an early and simple hypertext system.
However, the format of a single page for each application, the lack of classification within the sections and the relatively unsophisticated formatting facilities have motivated the development of alternative documentation systems, such as the previously mentioned
Most Unix GUI applications (particularly those built using the GNOME and KDE development environments) now provide end-user documentation in HTML and include embedded HTML viewers such as
yelp for reading the help within the application.
Usually the man pages are written in English. Translations into other languages can be also available on the system.
The default format of the man pages is troff, with either the macro package man (appearance oriented) or on some systems mdoc (semantic oriented). This makes it possible to typeset a man page to PostScript, PDF and various other formats for viewing or printing.
The man package on most modern linux distributions includes the man2html command which can be used to enable users to browse their man pages using a html browser.
In 2010, OpenBSD deprecated troff for formatting manpages in favour of mandoc, a specialised compiler/formatter for manpages with native support for output in PostScript, HTML, XHTML, and the terminal.
Full article ▸