man

From Initq

Jump to: navigation, search

Contents


History

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 the 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 info system.

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.

Manual sections

The manual is generally split into eight numbered sections, organized as follows (on BSD Unix and Linux):

Section Description
1 General commands
2 System calls
3 C library functions
4 Special files (usually devices, those found in /dev) and drivers
5 File formats and conventions
6 Games and screensavers
7 Miscellanea
8 System administration commands and daemons

To select a particular section you do:

 [alibaba@ohnonono etc]$ man 8 man
 No entry for man in section 8 of the manual
 [alibaba@ohnonono etc]$ man 3 man
 No entry for man in section 3 of the manual
 [alibaba@ohnonono etc]$ man 1 man

Layout

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, you get 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 definition. For experienced users, this may be all the documentation they need.
  • 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, ENVIRONMENT, KNOWN BUGS, FILES, AUTHOR, REPORTING BUGS, HISTORY and COPYRIGHT.

Flags

To locate a particular word in all the pages:

 [alibaba@ohnonono etc]$ man -k sex
 XGraphicsExposeEvent (3x)  - GraphicsExpose and NoExpose event structures
 XNoExposeEvent [XGraphicsExposeEvent] (3x)  - GraphicsExpose and NoExpose event structures
 XSetGraphicsExposure [XSetArcMode] (3x)  - GC convenience routines
 XtGetClassExtension  (3x)  - locate a class extension record
 glXUseXFont          (3gl)  - create bitmap display lists from an X font
Personal tools