Man page
Software documentation on Unix systems

A man page (sometimes spelled manpage), short for manual page, is a form of software documentation found on Unix and Unix-like operating systems. Topics covered include programs, system libraries, system calls, and sometimes local system details. The local host administrators can create and install manual pages associated with the specific host. A manual end user may invoke a documentation page by issuing the man command followed by the name of the item for which they want the documentation. These manual pages are typically requested by end users, programmers and administrators doing real time work but can also be formatted for printing.
By default, man typically uses a formatting program such as nroff with a macro package or mandoc, and also a terminal pager program such as more or less to display its output on the user's screen.
Man pages are often referred to as an online form of software documentation, even though the man command does not require Internet access, because man pages are available from a command-line interface with the man command or from a graphical user interface with a man-page viewer, rather than only being readable in printed form. The environment variable MANPATH often specifies a list of directory paths to search for the various documentation pages. Manual pages date back to when printed documentation was the norm.
01History
With some software, as of 1987, documentation was printed pages, available on the premises to users. At some sites, they were organized into steel binders, locked together in one monolithic steel reading rack, bolted to a table or counter, with pages organized for modular information updates, replacement, errata, and addenda. Popular manuals about microcomputers were advertised as being for sale in loose-leaf binders with regular updates.
In the first two years of the history of Unix, no documentation existed. 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 their manager Doug McIlroy in 1971. Aside from the man pages, the Programmer's Manual also accumulated a set of short papers, some of them tutorials (e.g. for general Unix usage, the C programming language, and tools such as Yacc), and others more detailed descriptions of operating system features. The printed version of the manual initially fit into a single binder, but as of PWB/UNIX and the 7th Edition of Research Unix, it was split into two volumes with the printed man pages forming Volume 1.
Later versions of the documentation imitated the first man pages' terseness. Ritchie added a "How to get started" section to the Third Edition introduction, and Lorinda Cherry provided the "Purple Card" pocket reference for the Sixth and Seventh Editions. Versions of the software were named after the revision of the manual; the seventh edition of the Unix Programmer's Manual, for example, came with the 7th Edition or Version 7 of Unix.
For the Fourth Edition the man pages were formatted using the troff typesetting package and its set of -man macros (which were completely revised between the Sixth and Seventh Editions of the Manual, but have since not drastically changed). 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 a man page, and many Unix users perceive a program's lack of man pages as a sign of low quality or incompleteness. Indeed, some projects, such as Debian, go out of their way to write man pages for programs lacking one. The modern descendants of 4.4BSD also distribute man pages as one of the primary forms of system documentation (having replaced the old -man macros with the newer -mdoc).
There was a hidden Easter egg in the man-db version of the man command that would cause the command to return "gimme gimme gimme" when run at 00:30 (a reference to the ABBA song Gimme! Gimme! Gimme! (A Man After Midnight)). It was introduced in 2011 but first restricted and then removed in 2017 after finally being found.

02Formatting
The default format of man pages is troff, with either the macro package man (appearance oriented) or mdoc (semantic oriented). This makes it possible to typeset a man page into PostScript, PDF, and various other formats for viewing or printing.
Some Unix systems have a package for the man2html command, which enables users to browse their man pages using an HTML browser. Systems with groff and man-db should use the higher-quality native HTML output (man --html) instead. The GNU Emacs program WoMan (from "WithOut man") allows for browsing man pages from the editor.
In 2010, OpenBSD deprecated troff for formatting man pages in favour of mandoc, a specialised compiler/formatter for man pages with native support for output in PostScript, HTML, XHTML, and the terminal. It is meant to only support a subset of troff used in manual pages, specifically those using mdoc macros.
Online services
Quite a few websites offer online access to manual pages from various Unix-like systems.
In February 2013, the BSD community saw a new open source mdoc.su service launched, which unified and shortened access to the man.cgi scripts of the major modern BSD projects through a unique nginx-based deterministic URL shortening service for the *BSD man pages.
For Linux, a man7.org service has been set up to serve manuals specific to the system. A ManKier service provides a wider selection, and integrates the TLDR pages too.
03Command usage
To read a manual page for a Unix command, a user can type:
man <command_name>Pages are traditionally referred to using the notation "name(section)": for example, ftp(1). The section refers to different ways the topic might be referenced - for example, as a system call, or a shell (command line) command or package, or a package's configuration file, or as a coding construct / header.
The same page name may appear in more than one section of the manual, such as when the names of system calls, user commands, or macro packages coincide. Examples are man(1) and man(7), or exit(2) and exit(3). The syntax for accessing the non-default manual section varies between different man implementations.
On Solaris and illumos, for example, the syntax for reading printf(3C) is:
man -s 3c printfOn Linux and BSD derivatives the same invocation would be:
man 3 printfwhich searches for printf in section 3 of the man pages. The actual file name likely includes the section. Continuing this example, printf.3.gz would be a compressed manual page file in section 3 for printf.

04Manual sections
The manual is generally split into eight numbered sections. Most systems today (e.g. BSD, macOS, Linux, and Solaris 11.4) inherit the numbering scheme used by Research Unix, while System V uses a different order:
| Common | System V | Description |
|---|---|---|
| 1 | 1 | General commands |
| 2 | 2 | System calls |
| 3 | 3 | Library functions, covering in particular the C standard library |
| 4 | 7 | Special files (usually devices, those found in /dev) and drivers |
| 5 | 4 | File formats and conventions |
| 6 | 6 | Games and screensavers |
| 7 | 5 | Miscellaneous |
| 8 | 1M | System administration commands and daemons |
POSIX APIs are present in both sections 2 and 3, where section 2 contains APIs that are implemented as system calls and section 3 contains APIs that are implemented as library routines.
On some systems, additional sections may be included, such as:
| Section | Description |
|---|---|
| 0 | C library header files (Unix v6) |
| 9 | Kernel routines (FreeBSD, SVR4, Linux) |
| l | LAPACK library functions |
| n | Tcl/Tk commands |
| x | The X Window System |
Some sections are further subdivided by means of a suffix; for example, in some systems, section 3C is for C library calls, 3M is for the math library, and so on. A consequence of this is that section 8 (system administration commands) is sometimes relegated to the 1M subsection of the main commands section. Some subsection suffixes have a general meaning across sections:
| Subsection | Description |
|---|---|
| p | POSIX specifications |
| x | X Window System documentation |
(Section 3 tends to be the exception, with many suffixes for different languages.)
Some versions of man cache the formatted versions of the last several pages viewed. One form is the cat page, simply piped to the pager for display.
05Layout
All man pages follow a common layout that is optimized for presentation on a simple ASCII text display, possibly without any form of highlighting or font control. Sections present may include:
- NAME
- The name of the command or function, followed by a one-line description of what it does.
- SYNOPSIS
- In the case of a command, a formal description of how to run it and what command line options it takes. For program functions, a list of the parameters the function takes and which header file contains its declaration.
- DESCRIPTION
- A textual description of the functioning of the command or function. For programs, this section often includes explanations of available command line options.
- EXAMPLES
- Some examples of common usage.
- SEE ALSO
- A list of related commands or functions.
Other sections may be present, but these are not well standardized across man pages. Common examples include: OPTIONS, EXIT STATUS, RETURN VALUE, ENVIRONMENT, BUGS, FILES, AUTHOR, REPORTING BUGS, HISTORY and COPYRIGHT.

Sources and credits
This article is adapted from the Wikipedia article “Man page”, written by its contributors and licensed under CC BY-SA 4.0. Fathomly has changed the layout, removed citation markers, navigation and maintenance notices, and adjusted punctuation. This adapted version is shared under the same license. For references, see the original article.
Images, from Wikimedia Commons:
- Sed stream editor (cropped).jpg by NairobiPapel, CC BY-SA 4.0
- Screenshot of "Xman" program.png by Chris Peterson (MIT X Consortium and its successors The Open Group and x.org), Barry Shein (Boston University), MIT
- OpenBSD Manpages Section 8 Intro.png by Huihermit, CC0
- FreeBSD typeset man page.png by Gordon Tetlow (manual page text) and Diomidis Spinellis (typesetting and capture), BSD
Fathomly is not affiliated with or endorsed by the Wikimedia Foundation. Spotted a problem? Tell us.