]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man7/man.7
proc.5: Add "um" and "uw" to VmFlags in /proc/[pid]/smaps
[thirdparty/man-pages.git] / man7 / man.7
CommitLineData
fea681da
MK
1.\" (C) Copyright 1992-1999 Rickard E. Faith and David A. Wheeler
2.\" (faith@cs.unc.edu and dwheeler@ida.org)
3.\"
93015253 4.\" %%%LICENSE_START(VERBATIM)
fea681da
MK
5.\" Permission is granted to make and distribute verbatim copies of this
6.\" manual provided the copyright notice and this permission notice are
7.\" preserved on all copies.
8.\"
9.\" Permission is granted to copy and distribute modified versions of this
10.\" manual under the conditions for verbatim copying, provided that the
11.\" entire resulting derived work is distributed under the terms of a
12.\" permission notice identical to this one.
c13182ef 13.\"
fea681da
MK
14.\" Since the Linux kernel and libraries are constantly changing, this
15.\" manual page may be incorrect or out-of-date. The author(s) assume no
16.\" responsibility for errors or omissions, or for damages resulting from
17.\" the use of the information contained herein. The author(s) may not
18.\" have taken the same level of care in the production of this manual,
19.\" which is licensed free of charge, as they might when working
20.\" professionally.
c13182ef 21.\"
fea681da
MK
22.\" Formatted or processed versions of this manual, if unaccompanied by
23.\" the source, must acknowledge the copyright and authors of this work.
4b72fb64 24.\" %%%LICENSE_END
fea681da
MK
25.\"
26.\" Modified Sun Jul 25 11:06:05 1993 by Rik Faith (faith@cs.unc.edu)
27.\" Modified Sat Jun 8 00:39:52 1996 by aeb
28.\" Modified Wed Jun 16 23:00:00 1999 by David A. Wheeler (dwheeler@ida.org)
29.\" Modified Thu Jul 15 12:43:28 1999 by aeb
fea681da
MK
30.\" Modified Sun Jan 6 18:26:25 2002 by Martin Schulze <joey@infodrom.org>
31.\" Modified Tue Jul 27 20:12:02 2004 by Colin Watson <cjwatson@debian.org>
a5e87f42 32.\" 2007-05-30, mtk: various rewrites and moved much text to new man-pages.7.
fea681da 33.\"
9ba01802 34.TH MAN 7 2019-03-06 "Linux" "Linux Programmer's Manual"
fea681da
MK
35.SH NAME
36man \- macros to format man pages
37.SH SYNOPSIS
38.B groff \-Tascii \-man
39.I file
40\&...
dd3568a1 41.PP
fea681da
MK
42.B groff \-Tps \-man
43.I file
44\&...
dd3568a1 45.PP
fea681da
MK
46.B man
47.RI [ section ]
48.I title
49.SH DESCRIPTION
50This manual page explains the
add00eab 51.B "groff an.tmac"
fea681da
MK
52macro package (often called the
53.B man
e7cbacd4 54macro package).
fea681da 55This macro package should be used by developers when
c13182ef
MK
56writing or porting man pages for Linux.
57It is fairly compatible with other
fea681da
MK
58versions of this macro package, so porting man pages should not be a major
59problem (exceptions include the NET-2 BSD release, which uses a totally
60different macro package called mdoc; see
61.BR mdoc (7)).
62.PP
63Note that NET-2 BSD mdoc man pages can be used with
64.B groff
65simply by specifying the
66.B \-mdoc
67option instead of the
68.B \-man
c13182ef
MK
69option.
70Using the
fea681da
MK
71.B \-mandoc
72option is, however, recommended, since this will automatically detect which
73macro package is in use.
e7cbacd4
MK
74.PP
75For conventions that should be employed when writing man pages
76for the Linux \fIman-pages\fP package, see
77.BR man-pages (7).
78.SS Title line
988db661 79The first command in a man page (after comment lines,
d1a71985 80that is, lines that start with \fB.\e"\fP) should be
6545cc56 81.PP
fea681da 82.RS
fea681da 83.B \&.TH
0daa9e92 84.I "title section date source manual"
fea681da 85.RE
6545cc56 86.PP
aeb9b6a6
MK
87For details of the arguments that should be supplied to the
88.B TH
e7cbacd4
MK
89command, see
90.BR man-pages (7).
fea681da
MK
91.PP
92Note that BSD mdoc-formatted pages begin with the
93.B Dd
94command, not the
95.B TH
96command.
e6b9359d 97.SS Sections
fea681da
MK
98Sections are started with
99.B \&.SH
c13182ef 100followed by the heading name.
e6b9359d 101.\" The following doesn't seem to be required (see Debian bug 411303),
dc936104
MK
102.\" If the name contains spaces and appears
103.\" on the same line as
104.\" .BR \&.SH ,
105.\" then place the heading in double quotes.
5711c04f 106.PP
226ae424 107The only mandatory heading is NAME, which should be the first section and
a1712680 108be followed on the next line by a one-line description of the program:
6545cc56 109.PP
fea681da 110.RS
fea681da
MK
111\&.SH NAME
112.br
d1a71985 113item \e- description
fea681da 114.RE
6545cc56 115.PP
fea681da 116It is extremely important that this format is followed, and that there is a
a1712680 117backslash before the single dash which follows the item name.
c13182ef 118This syntax is used by the
a1712680
MK
119.BR mandb (8)
120program to create a database of short descriptions for the
fea681da
MK
121.BR whatis (1)
122and
123.BR apropos (1)
124commands.
a1712680
MK
125(See
126.BR lexgrog (1)
127for further details on the syntax of the NAME section.)
fea681da 128.PP
e7cbacd4
MK
129For a list of other sections that might appear in a manual page, see
130.BR man-pages (7).
e6b9359d 131.SS Fonts
fea681da
MK
132The commands to select the type face are:
133.TP 4
134.B \&.B
135Bold
136.TP
137.B \&.BI
138Bold alternating with italics
139(especially useful for function specifications)
140.TP
141.B \&.BR
142Bold alternating with Roman
143(especially useful for referring to other
144manual pages)
145.TP
146.B \&.I
147Italics
148.TP
149.B \&.IB
150Italics alternating with bold
151.TP
152.B \&.IR
153Italics alternating with Roman
154.TP
155.B \&.RB
156Roman alternating with bold
157.TP
158.B \&.RI
159Roman alternating with italics
160.TP
161.B \&.SB
162Small alternating with bold
163.TP
164.B \&.SM
165Small (useful for acronyms)
dd3568a1 166.PP
fea681da
MK
167Traditionally, each command can have up to six arguments, but the GNU
168implementation removes this limitation (you might still want to limit
169yourself to 6 arguments for portability's sake).
c13182ef
MK
170Arguments are delimited by spaces.
171Double quotes can be used to specify an argument which contains spaces.
172All of the arguments will be printed next to each other without
fea681da
MK
173intervening spaces, so that the
174.B \&.BR
175command can be used to specify a word in bold followed by a mark of
176punctuation in Roman.
177If no arguments are given, the command is applied to the following line
178of text.
73d8cece 179.SS Other macros and strings
fea681da
MK
180.PP
181Below are other relevant macros and predefined strings.
182Unless noted otherwise, all macros
183cause a break (end the current line of text).
184Many of these macros set or use the "prevailing indent."
185The "prevailing indent" value is set by any macro with the parameter
186.I i
187below;
188macros may omit
189.I i
190in which case the current prevailing indent will be used.
191As a result, successive indented paragraphs can use the same indent without
3b777aff 192respecifying the indent value.
24b74457 193A normal (nonindented) paragraph resets the prevailing indent value
fea681da 194to its default value (0.5 inches).
f34cce68 195By default, a given indent is measured in ens;
75fa8557 196try to use ens or ems as units for
fea681da
MK
197indents, since these will automatically adjust to font size changes.
198The other key macro definitions are:
73d8cece 199.SS Normal paragraphs
fea681da
MK
200.TP 9m
201.B \&.LP
202Same as
203.B \&.PP
204(begin a new paragraph).
205.TP
206.B \&.P
207Same as
208.B \&.PP
209(begin a new paragraph).
210.TP
211.B \&.PP
212Begin a new paragraph and reset prevailing indent.
73d8cece 213.SS Relative margin indent
fea681da
MK
214.TP 9m
215.BI \&.RS " i"
4d9b6984 216Start relative margin indent: moves the left margin
fea681da
MK
217.I i
218to the right (if
219.I i
220is omitted, the prevailing indent value is used).
221A new prevailing indent is set to 0.5 inches.
222As a result, all following paragraph(s) will be
223indented until the corresponding
224.BR \&.RE .
225.TP
226.B \&.RE
227End relative margin indent and
228restores the previous value of the prevailing indent.
73d8cece 229.SS Indented paragraph macros
fea681da
MK
230.TP 9m
231.BI \&.HP " i"
232Begin paragraph with a hanging indent
233(the first line of the paragraph is at the left margin of
234normal paragraphs, and the rest of the paragraph's lines are indented).
235.TP
236.BI \&.IP " x i"
237Indented paragraph with optional hanging tag.
238If the tag
239.I x
240is omitted, the entire following paragraph is indented by
241.IR i .
242If the tag
243.I x
244is provided, it is hung at the left margin
245before the following indented paragraph
246(this is just like
0daa9e92 247.B \&.TP
fea681da
MK
248except the tag is included with the command instead of being on the
249following line).
250If the tag is too long, the text after the tag will be moved down to the
251next line (text will not be lost or garbled).
31a6818e 252For bulleted lists, use this macro with \e(bu (bullet) or \e(em (em dash)
fea681da
MK
253as the tag, and for numbered lists, use the number or letter followed by
254a period as the tag;
255this simplifies translation to other formats.
256.TP
257.BI \&.TP " i"
c13182ef
MK
258Begin paragraph with hanging tag.
259The tag is given on the next line, but
fea681da
MK
260its results are like those of the
261.B \&.IP
262command.
73d8cece 263.SS Hypertext link macros
fea681da 264.TP
e043552f
BR
265.BI \&.UR " url"
266Insert a hypertext link to the URI (URL)
267.IR url ,
268with all text up to the following
269.B \&.UE
270macro as the link text.
dd1b9170 271.TP
e043552f
BR
272.B \&.UE \c
273.RI [ trailer ]
274Terminate the link text of the preceding
275.B \&.UR
276macro, with the optional
277.I trailer
278(if present, usually a closing parenthesis and/or end-of-sentence
279punctuation) immediately following.
280For non-HTML output devices (e.g.,
281.BR "man -Tutf8" ),
282the link text is followed by the URL in angle brackets; if there is no
283link text, the URL is printed as its own link text, surrounded by angle
284brackets.
285(Angle brackets may not be available on all output devices.)
286For the HTML output device, the link text is hyperlinked to the URL; if
287there is no link text, the URL is printed as its own link text.
fea681da 288.PP
e043552f
BR
289These macros have been supported since GNU Troff 1.20 (2009-01-05) and
290Heirloom Doctools Troff since 160217 (2016-02-17).
73d8cece 291.SS Miscellaneous macros
fea681da
MK
292.TP 9m
293.B \&.DT
294Reset tabs to default tab values (every 0.5 inches);
295does not cause a break.
296.TP
297.BI \&.PD " d"
298Set inter-paragraph vertical distance to d
299(if omitted, d=0.4v);
300does not cause a break.
301.TP
302.BI \&.SS " t"
303Subheading
304.I t
305(like
306.BR \&.SH ,
307but used for a subsection inside a section).
73d8cece 308.SS Predefined strings
fea681da
MK
309The
310.B man
311package has the following predefined strings:
31a6818e 312.IP \e*R
fea681da 313Registration Symbol: \*R
31a6818e 314.IP \e*S
fea681da 315Change to default font size
31a6818e 316.IP \e*(Tm
fea681da 317Trademark Symbol: \*(Tm
31a6818e 318.IP \e*(lq
eb1af896 319Left angled double quote: \*(lq
31a6818e 320.IP \e*(rq
eb1af896 321Right angled double quote: \*(rq
73d8cece 322.SS Safe subset
fea681da
MK
323Although technically
324.B man
325is a troff macro package, in reality a large number of other tools
326process man page files that don't implement all of troff's abilities.
91749c0c
MK
327Thus, it's best to avoid some of troff's more exotic abilities
328where possible to permit these other tools to work correctly.
fea681da
MK
329Avoid using the various troff preprocessors
330(if you must, go ahead and use
331.BR tbl (1),
332but try to use the
333.B IP
c13182ef 334and
fea681da
MK
335.B TP
336commands instead for two-column tables).
337Avoid using computations; most other tools can't process them.
338Use simple commands that are easy to translate to other formats.
339The following troff macros are believed to be safe (though in many cases
340they will be ignored by translators):
31a6818e 341.BR \e" ,
fea681da
MK
342.BR . ,
343.BR ad ,
344.BR bp ,
345.BR br ,
346.BR ce ,
347.BR de ,
348.BR ds ,
349.BR el ,
350.BR ie ,
351.BR if ,
352.BR fi ,
353.BR ft ,
354.BR hy ,
355.BR ig ,
356.BR in ,
357.BR na ,
358.BR ne ,
359.BR nf ,
360.BR nh ,
361.BR ps ,
362.BR so ,
363.BR sp ,
364.BR ti ,
365.BR tr .
366.PP
367You may also use many troff escape sequences (those sequences beginning
31a6818e 368with \e).
fea681da 369When you need to include the backslash character as normal text,
31a6818e 370use \ee.
fea681da
MK
371Other sequences you may use, where x or xx are any characters and N
372is any digit, include:
6f25f547
JW
373.BR \e\(aq ,
374.BR \e\(ga ,
31a6818e
MK
375.BR \e- ,
376.BR \e. ,
377.BR \e" ,
378.BR \e% ,
379.BR \e*x ,
380.BR \e*(xx ,
381.BR \e(xx ,
382.BR \e$N ,
383.BR \enx ,
384.BR \en(xx ,
385.BR \efx ,
fea681da 386and
31a6818e 387.BR \ef(xx .
fea681da
MK
388Avoid using the escape sequences for drawing graphics.
389.PP
390Do not use the optional parameter for
391.B bp
392(break page).
393Use only positive values for
394.B sp
395(vertical space).
396Don't define a macro
397.RB ( de )
398with the same name as a macro in this or the
399mdoc macro package with a different meaning; it's likely that
400such redefinitions will be ignored.
401Every positive indent
402.RB ( in )
403should be paired with a matching negative indent
404(although you should be using the
405.B RS
406and
407.B RE
408macros instead).
409The condition test
410.RB ( if,ie )
9708eb37 411should only have \(aqt\(aq or \(aqn\(aq as the condition.
c13182ef 412Only translations
fea681da
MK
413.RB ( tr )
414that can be ignored should be used.
415Font changes
416.RB ( ft
31a6818e 417and the \fB\ef\fP escape sequence)
fea681da
MK
418should only have the values 1, 2, 3, 4, R, I, B, P, or CW
419(the ft command may also have no parameters).
420.PP
421If you use capabilities beyond these, check the
422results carefully on several tools.
423Once you've confirmed that the additional capability is safe,
424let the maintainer of this
425document know about the safe command or sequence
426that should be added to this list.
2b2581ee 427.SH FILES
add00eab 428.IR /usr/share/groff/ [*/] tmac/an.tmac
2b2581ee
MK
429.br
430.I /usr/man/whatis
fea681da
MK
431.SH NOTES
432.PP
433By all means include full URLs (or URIs) in the text itself;
434some tools such as
435.BR man2html (1)
436can automatically turn them into hypertext links.
e043552f
BR
437You can also use the
438.B UR
439and
440.B UE
441macros to identify links to related information.
fea681da 442If you include URLs, use the full URL
608bf950 443(e.g.,
6ade226b 444.UR http://www.kernel.org
608bf950
SK
445.UE )
446to ensure that tools can automatically find the URLs.
fea681da
MK
447.PP
448Tools processing these files should open the file and examine the first
24b74457 449nonwhitespace character.
6f25f547 450A period (.) or single quote (\(aq) at the beginning
91749c0c 451of a line indicates a troff-based file (such as man or mdoc).
fea681da 452A left angle bracket (<) indicates an SGML/XML-based
c13182ef
MK
453file (such as HTML or Docbook).
454Anything else suggests simple ASCII
fea681da
MK
455text (e.g., a "catman" result).
456.PP
6f25f547 457Many man pages begin with \fB\(aq\e"\fP followed by a
91749c0c 458space and a list of characters,
fea681da 459indicating how the page is to be preprocessed.
91749c0c
MK
460For portability's sake to non-troff translators we recommend
461that you avoid using anything other than
fea681da
MK
462.BR tbl (1),
463and Linux can detect that automatically.
464However, you might want to include this information so your man page
465can be handled by other (less capable) systems.
466Here are the definitions of the preprocessors invoked by these characters:
467.TP 3
468.B e
469eqn(1)
470.TP
471.B g
472grap(1)
473.TP
474.B p
475pic(1)
476.TP
477.B r
478refer(1)
479.TP
480.B t
481tbl(1)
482.TP
483.B v
484vgrind(1)
fea681da
MK
485.SH BUGS
486.PP
487Most of the macros describe formatting (e.g., font type and spacing) instead
488of marking semantic content (e.g., this text is a reference to another page),
489compared to formats like mdoc and DocBook (even HTML has more semantic
490markings).
491This situation makes it harder to vary the
492.B man
493format for different media,
494to make the formatting consistent for a given media, and to automatically
495insert cross-references.
496By sticking to the safe subset described above, it should be easier to
497automate transitioning to a different reference page format in the future.
dd3568a1 498.PP
fea681da
MK
499The Sun macro
500.B TX
501is not implemented.
fd7f0a7f
MK
502.\" .SH AUTHORS
503.\" .IP \(em 3m
504.\" James Clark (jjc@jclark.com) wrote the implementation of the macro package.
505.\" .IP \(em
506.\" Rickard E. Faith (faith@cs.unc.edu) wrote the initial version of
507.\" this manual page.
508.\" .IP \(em
509.\" Jens Schweikhardt (schweikh@noc.fdn.de) wrote the Linux Man-Page Mini-HOWTO
510.\" (which influenced this manual page).
511.\" .IP \(em
512.\" David A. Wheeler (dwheeler@ida.org) heavily modified this
513.\" manual page, such as adding detailed information on sections and macros.
47297adb 514.SH SEE ALSO
fea681da
MK
515.BR apropos (1),
516.BR groff (1),
a1712680 517.BR lexgrog (1),
fea681da
MK
518.BR man (1),
519.BR man2html (1),
e7cbacd4 520.BR whatis (1),
d81dc982 521.BR groff_man (7),
fea681da 522.BR groff_www (7),
e7cbacd4 523.BR man-pages (7),
5f3523f8 524.BR mdoc (7)