Aman page(short formanual page) is a form ofsoftware documentationusually found on aUnixorUnix-likeoperating system.Topics covered includecomputer programs(includinglibraryandsystem calls), formal standards and conventions, and even abstract concepts. Ausermay invoke a man page by issuing theman
command.
By default,man
typically uses aterminal pagerprogram such asmore
orless
to display its output.
Man pages are often referred to as anon-lineoronlineform of software documentation,[1]even though theman
command does not require internet access, dating back to the times when printedout-of-bandmanuals were the norm.
History
editBefore Unix (e.g.,GCOS), documentation was printed pages, available on the premises to users (staff, students...), 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.[citation needed]
In the first two years of thehistory of Unix,no documentation existed.[2]TheUnix Programmer's Manualwas first published on November 3, 1971. The first actual man pages were written byDennis RitchieandKen Thompsonat the insistence[citation needed]of their managerDoug McIlroyin 1971. Aside from the man pages, theProgrammer's Manualalso accumulated a set of short papers, some of themtutorials(e.g. for general Unix usage, theCprogramming language, and tools such asYacc), and others more detailed descriptions of operating system features. The printed version of the manual initially fit into a single binder, but as ofPWB/UNIXand the7th EditionofResearch Unix,it was split into two volumes with the printed man pages forming Volume 1.[3]
Later versions of the documentation imitated the first man pages' terseness. Ritchie added a "How to get started" section to theThird Editionintroduction, andLorinda Cherryprovided the "Purple Card" pocket reference for theSixthandSeventhEditions.[2]Versions of the software were named after the revision of the manual; the seventh edition of theUnix Programmer's Manual,for example, came with the 7th Edition or Version 7 of Unix.[4]
For theFourthEdition the man pages were formatted using thetrofftypesetting package[2]and its set of-man
macros (which were completely revised between the Sixth and Seventh Editions of theManual,[3]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; indeed, some projects, such asDebian,go out of their way to write man pages for programs lacking one. The modern descendants of4.4BSDalso 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 hiddenEaster eggin 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 theABBAsongGimme! Gimme! Gimme! (A Man After Midnight).It was introduced in 2011[5]but first restricted[6]and then removed in 2017[7]after finally being found.[8]
Formatting
editThe default format of man pages istroff,with either themacro packageman (appearance oriented) or mdoc (semantic oriented). This makes it possible to typeset a man page intoPostScript,PDF,and various other formats for viewing or printing.
SomeUnixsystems have a package for theman2htmlcommand, 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. TheGNU EmacsprogramWoMan(from "WithOut man" ) allows to browse man pages from the editor.[9]
In 2010,OpenBSDdeprecatedtrofffor formatting man pages in favour ofmandoc,a specialised compiler/formatter for man pages with native support for output inPostScript,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
editQuite a few websites offer online access to manual pages from various Unix-like systems.
In February 2013, theBSDcommunity saw a new open sourcemdoc.suservice launched, which unified and shortened access to the man.cgi scripts of the major modern BSD projects through a uniquenginx-based deterministicURL shorteningservice for the *BSD man pages.[10][11][12]
For Linux, a man7.org service has been set up to serve manuals specific to the system.[13]A ManKier service provides a wider selection, and integrates the TLDR pages too.[14]
Command usage
editTo 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,
.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 ofsystem calls,usercommands,ormacro packagescoincide. Examples are and ,or and .The syntax for accessing the non-default manual section varies between different man implementations.
On Solaris and illumos, for example, the syntax for reading
is:man-s3cprintf
On Linux and BSD derivatives the same invocation would be:
man3printf
which searches forprintfin section 3 of the man pages.
Manual sections
editThe manual is generally split into eight numbered sections. Most systems today (e.g.BSD,[15]macOS,Linux,[16]andSolaris11.4) inherit the numbering scheme used byResearch Unix.[17][18]WhileSystem Vuses a different order:[19]
Common | System V | Description |
---|---|---|
1 | 1 | Generalcommands |
2 | 2 | System calls |
3 | 3 | Libraryfunctions, covering in particular theC standard library |
4 | 7 | Special files(usually devices, those found in /dev) anddrivers |
5 | 4 | File formatsand conventions |
6 | 6 | Gamesandscreensavers |
7 | 5 | Miscellaneous |
8 | 1M | System administrationcommandsanddaemons |
POSIXAPIs 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 some of the following sections are available:
Section | Description |
---|---|
0 | C libraryheader files(Unix v6) |
9 | Kernelroutines (FreeBSD, SVR4, Linux)[18][15] |
l | LAPACKlibrary functions[20] |
n | Tcl/Tkcommands |
x | TheX 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 | POSIXspecifications |
x | X Window Systemdocumentation |
(Section 3 tends to be the exception with the many suffixes for different languages.)
Some versions ofman
cache the formatted versions of the last several pages viewed. One form is thecat page,simply piped to the pager for display.
Layout
editAll man pages follow a common layout that is optimized for presentation on a simpleASCIItext display, possibly without any form of highlighting or font control. Sections present may include:[21]: MANUAL STRUCTURE
- 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.
- 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.
Authoring
editManual pages can be written either in the oldman
macros, the newdoc
macros, or a combination of both (mandoc
).[22]Theman
macro set provides minimalrich textfunctions, with directives for the title line, section headers, (bold, small or italic) fonts, paragraphs and adding/reducing indentation.[23]The newermdoc
language is more semantic in nature, and contains specialized macros for most standard sections such as program name, synopsis, function names, and the name of the authors. This information can be used to implement asemantic searchfor manuals by programs such asmandoc.Although it also includes directives to directly control the styling, it is expected that the specialized macros will cover most of the use-cases.[21]Both the mandoc and the groff projects considermdoc
the preferred format for new documents.[24]
Although man pages are, to troff, text laid out using 10-pointRoman type,this distinction is usually moot because man pages are viewed in the terminal (TTY) instead of laid out on paper. As a result, the "small font" macro is seldom used.[25]On the other hand, bold and italic text is supported by the terminal viaECMA-48,and groff'sgrotty
does emit them as requested when it detects a supporting terminal. The BSD mandoc however only supports bold and underlined (as a replacement for italics) text via the typewriter backspace-then-overstrike sequence, which needs to be translated into ECMA-48 byless
.[26][27]
Some tools have been used to convert documents in a less contrived format to manual pages. Examples include GNU'shelp2man
,which takes a--help
output and some additional content to generate a manual page.[28]The manual would be barely more useful than the said output, but for GNU programs this is not an issue as texinfo is the main documentation system.[29]A number of tools, includingpandoc,ronn, and md2man support conversion fromMarkdownto manual pages. All these tools emit theman
format, as Markdown is not expressive enough to match the semantic content ofmdoc
.DocBookhas an inbuilt man(7) converter – of appalling quality, according to mandoc's author[30]who wrote a separate mdoc(7) converter.
Man pages are usually written in English, but translations into other languages may be available on the system. The GNUman-db
and the mandocman
is known to search for localized manual pages under subdirectories.[31][16]: Overview [15]
Alternatives
editFew alternatives toman
have enjoyed much popularity, with the possible exception ofGNU Project's"info
"system, an early and simplehypertextsystem. There is also a third-party effort known asTLDR pages(tldr
) that provides simple examples for common use cases, similar to acheatsheet.[32]
In addition, some UnixGUIapplications (particularly those built using theGNOMEandKDEdevelopment environments) now provide end-user documentation inHTMLand include embedded HTML viewers such asyelp
for reading the help within the application. An HTML system inEmacsis also slated to replace texinfo.[33]
See also
edit- List of Unix commands
- List of Plan 9 applications
info
apropos
- README
- RTFM
- ManOpen–NeXT/macOSgraphical man utility
References
edit- ^"man(1)".FreeBSD General Commands Manual.Archivedfrom the original on 2023-01-30.Retrieved2023-07-15.
- ^abcMcIlroy, M. D.(1987).A Research Unix reader: annotated excerpts from the Programmer's Manual, 1971–1986(PDF)(Technical report). CSTR. Bell Labs. 139.Archived(PDF)from the original on 2017-11-11.Retrieved2015-02-01.
- ^abDarwin, Ian; Collyer, Geoffrey."UNIX Evolution: 1975-1984 Part I - Diversity".Archivedfrom the original on 17 July 2012.Retrieved22 December2012.Originally published inMicrosystems5(11), November 1984.
- ^Fiedler, Ryan (October 1983)."The Unix Tutorial / Part 3: Unix in the Microcomputer Marketplace".BYTE.p. 132.Retrieved30 January2015.
- ^"GIT commit 002a6339b1fe8f83f4808022a17e1aa379756d99".Archivedfrom the original on 4 December 2017.Retrieved22 November2017.
- ^"GIT commit 84bde8d8a9a357bd372793d25746ac6b49480525".Archivedfrom the original on 5 September 2018.Retrieved22 November2017.
- ^"GIT commit b225d9e76fbb0a6a4539c0992fba88c83f0bd37e".Archivedfrom the original on 9 November 2020.Retrieved25 September2018.
- ^""Why does man print" gimme gimme gimme "at 00:30?"".Archivedfrom the original on 21 November 2017.Retrieved22 November2017.
- ^Wright, Francis J."WoMan: Browse Unix Manual Pages" W.O. (without) Man "".GNU.Archivedfrom the original on 11 November 2020.Retrieved3 August2020.
- ^Pali, Gabor, ed. (12 May 2013)."FreeBSD Quarterly Status Report, January-March 2013".FreeBSD.Archivedfrom the original on 22 December 2014.Retrieved25 December2014.
- ^Murenin, Constantine A. (19 February 2013)."announcing mdoc.su, short manual page URLs".[email protected](Mailing list).Archivedfrom the original on 7 August 2014.Retrieved25 December2014.
- ^Murenin, Constantine A. (23 February 2013)."mdoc.su — Short manual page URLs for FreeBSD, OpenBSD, NetBSD and DragonFly BSD".Archivedfrom the original on 17 December 2014.Retrieved25 December2014.
- ^"Linux man pages online".man7.org.Archivedfrom the original on 2020-05-07.Retrieved2020-05-05.
- ^"About".ManKier.Archivedfrom the original on 2020-04-25.Retrieved2020-05-05.
- ^abcFreeBSDGeneral CommandsManual –
- ^abLinuxGeneral CommandsManual –
- ^"Manual Pages for Research Unix Eighth Edition".man.cat-v.org.Archivedfrom the original on 2020-06-30.Retrieved2020-05-06.
- ^ab"Unix Programmer's Manual - Introduction".www.bell-labs.com.November 3, 1971.Archivedfrom the original on June 1, 2020.RetrievedMay 6,2020.
- ^"System V release 4 manuals".bitsavers.trailing-edge.com.Archivedfrom the original on 2020-08-03.Retrieved2020-05-06.
- ^"lapack (l) - Linux Man Pages".www.systutorials.com.Archivedfrom the original on 2023-03-11.Retrieved2021-05-29.
- ^abFreeBSDMiscellaneous InformationManual –
- ^LinuxFile FormatsManual –
- ^LinuxMiscellaneaManual –
- ^"Groff Mission Statement - 2014".www.gnu.org.Archivedfrom the original on 2020-12-03.Retrieved2021-01-02.
Concurrent with work on man(7), mdoc(7) will be actively supported and its use promoted.
- ^"man".The GNU Troff Manual.Archivedfrom the original on 24 December 2019.Retrieved31 December2019.
- ^"Italics and colour in manual pages on a nosh user-space virtual terminal".jdebp.eu.Archivedfrom the original on 2021-01-28.Retrieved2021-01-21.
- ^FreeBSDGeneral CommandsManual."Font styles are applied by using back-spaced encoding..." –
- ^"help2man Reference Manual".Archivedfrom the original on 6 March 2023.Retrieved5 March2023.
- ^"Man Pages (GNU Coding Standards)".www.gnu.org.Archivedfrom the original on 2023-03-05.Retrieved2023-03-05.
- ^Ingo Schwarze."New mandoc -mdoc -T markdown converter".undeadly.org.Archivedfrom the original on 2023-03-05.Retrieved2023-03-05.– for specific complaints by the author, seeIngo Schwarze (28 February 2014)."Re: Groff man pages (tangential to Future Redux)".Groff(Mailing list).Archivedfrom the original on 2023-03-05.
- ^"command line - Linux man pages in different languages".Ask Ubuntu.Archivedfrom the original on 2023-03-11.Retrieved2020-05-05.
- ^"TLDR pages".tldr.sh.Archivedfrom the original on 2020-04-27.Retrieved2020-05-05.
- ^Raymond, Eric S."Re: [Groff] man pages (tangential to Future Redux)".groff(Mailing list).Archivedfrom the original on 2023-03-05.Retrieved2023-03-05– via lists.gnu.org.
External links
edit- History of UNIX Manpagesfor a primary-source history of UNIX man pages.
- UNIX and Linux Man Page Repositorywith nearly 300,000 well formatted man pages.
- What do the numbers in a man page mean?
- FreeBSD Manual Pages,freebsd.org – has also man pages for Darwin, Debian, HP-UX, IRIS, NetBSD, OpenBSD, NextSTEP, SunOS and more