Creating MAN Pages Cheat Sheet
 

MAN?

‘man’ = abbreviation for a "manual"
To find more help on creating and editing man pages, see   man –s5 man
To see examples of man pages, check files in /usr/man
 

How is man organized?

    .TH title [1-9]
          The name of the command or function, which serves as a title of the man page, followed by a section number.

    .SH NAME
           The name, or list of names, by which the command is called, followed by a dash and then a one-line summary of the action performed.

    .SH SYNOPSIS
           The syntax of the command and its arguments, as typed on the command line.

    .SH DESCRIPTION
           A narrative overview of the command or function’s external behavior.

    .SH OPTIONS
           The list of options along with a description of how each affects the command’s operation.

    .SH RETURN VALUES
           A list of the values the library routine will return to the calling program and the conditions that cause these values to be returned.

    .SH EXIT STATUS
           A list of the values the utility will return to the calling program or shell, and the conditions that cause these values to be returned.

    .SH SEE ALSO
           A comma-separated list of related manual pages, followed by references to other published materials.

    .SH BUGS
           A description of limitations, known defects, and possible problems associated with the command or function.

Project note: if you write man pages in nroff format, include the above nroff instructions in your README file.