xref: /netbsd-src/external/bsd/mdocml/dist/man.1 (revision 544c191c349c1704c9d5e679d12ec15cff579663)
1*544c191cSchristos.\"	Id: man.1,v 1.35 2019/03/09 15:55:01 schwarze Exp
2fec65c98Schristos.\"
3fec65c98Schristos.\" Copyright (c) 1989, 1990, 1993
4fec65c98Schristos.\"	The Regents of the University of California.  All rights reserved.
5fec65c98Schristos.\" Copyright (c) 2003, 2007, 2008, 2014 Jason McIntyre <jmc@openbsd.org>
6*544c191cSchristos.\" Copyright (c) 2010, 2011, 2014-2018 Ingo Schwarze <schwarze@openbsd.org>
7fec65c98Schristos.\"
8fec65c98Schristos.\" Redistribution and use in source and binary forms, with or without
9fec65c98Schristos.\" modification, are permitted provided that the following conditions
10fec65c98Schristos.\" are met:
11fec65c98Schristos.\" 1. Redistributions of source code must retain the above copyright
12fec65c98Schristos.\"    notice, this list of conditions and the following disclaimer.
13fec65c98Schristos.\" 2. Redistributions in binary form must reproduce the above copyright
14fec65c98Schristos.\"    notice, this list of conditions and the following disclaimer in the
15fec65c98Schristos.\"    documentation and/or other materials provided with the distribution.
16fec65c98Schristos.\" 3. Neither the name of the University nor the names of its contributors
17fec65c98Schristos.\"    may be used to endorse or promote products derived from this software
18fec65c98Schristos.\"    without specific prior written permission.
19fec65c98Schristos.\"
20fec65c98Schristos.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21fec65c98Schristos.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22fec65c98Schristos.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23fec65c98Schristos.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24fec65c98Schristos.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25fec65c98Schristos.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26fec65c98Schristos.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27fec65c98Schristos.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28fec65c98Schristos.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29fec65c98Schristos.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30fec65c98Schristos.\" SUCH DAMAGE.
31fec65c98Schristos.\"
32fec65c98Schristos.\"     @(#)man.1	8.2 (Berkeley) 1/2/94
33fec65c98Schristos.\"
34*544c191cSchristos.Dd March 9, 2019
35fec65c98Schristos.Dt MAN 1
36fec65c98Schristos.Os
37fec65c98Schristos.Sh NAME
38fec65c98Schristos.Nm man
39fec65c98Schristos.Nd display manual pages
40fec65c98Schristos.Sh SYNOPSIS
41fec65c98Schristos.Nm man
42fec65c98Schristos.Op Fl acfhklw
43fec65c98Schristos.Op Fl C Ar file
44fec65c98Schristos.Op Fl M Ar path
45fec65c98Schristos.Op Fl m Ar path
46fec65c98Schristos.Op Fl S Ar subsection
47c9bcef03Schristos.Op Oo Fl s Oc Ar section
48fec65c98Schristos.Ar name ...
49fec65c98Schristos.Sh DESCRIPTION
50fec65c98SchristosThe
51fec65c98Schristos.Nm
52fec65c98Schristosutility
53fec65c98Schristosdisplays the
54fec65c98Schristosmanual pages entitled
55fec65c98Schristos.Ar name .
56fec65c98SchristosPages may be selected according to
57fec65c98Schristosa specific category
58fec65c98Schristos.Pq Ar section
59fec65c98Schristosor
60fec65c98Schristosmachine architecture
61fec65c98Schristos.Pq Ar subsection .
62fec65c98Schristos.Pp
63fec65c98SchristosThe options are as follows:
64fec65c98Schristos.Bl -tag -width Ds
65fec65c98Schristos.It Fl a
669508192eSchristosDisplay all matching manual pages.
679508192eSchristosNormally, only the first page found is displayed.
68fec65c98Schristos.It Fl C Ar file
69fec65c98SchristosUse the specified
70fec65c98Schristos.Ar file
71fec65c98Schristosinstead of the default configuration file.
72fec65c98SchristosThis permits users to configure their own manual environment.
73fec65c98SchristosSee
74fec65c98Schristos.Xr man.conf 5
75fec65c98Schristosfor a description of the contents of this file.
76fec65c98Schristos.It Fl c
77fec65c98SchristosCopy the manual page to the standard output instead of using
78fec65c98Schristos.Xr more 1
79fec65c98Schristosto paginate it.
80fec65c98SchristosThis is done by default if the standard output is not a terminal device.
81c9bcef03Schristos.Pp
82c9bcef03SchristosWhen using
83c9bcef03Schristos.Fl c ,
84c9bcef03Schristosmost terminal devices are unable to show the markup.
85c9bcef03SchristosTo print the output of
86c9bcef03Schristos.Nm
87c9bcef03Schristosto the terminal with markup but without using a pager, pipe it to
88c9bcef03Schristos.Xr ul 1 .
89c9bcef03SchristosTo remove the markup, pipe the output to
90c9bcef03Schristos.Xr col 1
91c9bcef03Schristos.Fl b
92c9bcef03Schristosinstead.
93fec65c98Schristos.It Fl f
94fec65c98SchristosA synonym for
95fec65c98Schristos.Xr whatis 1 .
96fec65c98SchristosIt searches for
97fec65c98Schristos.Ar name
98fec65c98Schristosin manual page names and displays the header lines from all matching pages.
99fec65c98SchristosThe search is case insensitive and matches whole words only.
1009508192eSchristos.It Fl h
1019508192eSchristosDisplay only the SYNOPSIS lines of the requested manual pages.
1029508192eSchristosImplies
1039508192eSchristos.Fl a
1049508192eSchristosand
1059508192eSchristos.Fl c .
106fec65c98Schristos.It Fl k
107fec65c98SchristosA synonym for
108fec65c98Schristos.Xr apropos 1 .
109fec65c98SchristosInstead of
110fec65c98Schristos.Ar name ,
111fec65c98Schristosan expression can be provided using the syntax described in the
112fec65c98Schristos.Xr apropos 1
113fec65c98Schristosmanual.
114fec65c98SchristosBy default, it displays the header lines of all matching pages.
115fec65c98Schristos.It Fl l
116fec65c98SchristosA synonym for
117c9bcef03Schristos.Xr mandoc 1 .
118fec65c98SchristosThe
119fec65c98Schristos.Ar name
120fec65c98Schristosarguments are interpreted as filenames.
121fec65c98SchristosNo search is done and
122fec65c98Schristos.Ar file ,
123fec65c98Schristos.Ar path ,
124fec65c98Schristos.Ar section ,
125c9bcef03Schristos.Ar subsection ,
126fec65c98Schristosand
127fec65c98Schristos.Fl w
128c9bcef03Schristosare ignored.
129c9bcef03SchristosThis option implies
130c9bcef03Schristos.Fl a .
131fec65c98Schristos.It Fl M Ar path
132fec65c98SchristosOverride the list of standard directories which
133fec65c98Schristos.Nm
134fec65c98Schristossearches for manual pages.
135fec65c98SchristosThe supplied
136fec65c98Schristos.Ar path
137fec65c98Schristosmust be a colon
138fec65c98Schristos.Pq Ql \&:
139fec65c98Schristosseparated list of directories.
140fec65c98SchristosThis search path may also be set using the environment variable
141fec65c98Schristos.Ev MANPATH .
142fec65c98Schristos.It Fl m Ar path
143fec65c98SchristosAugment the list of standard directories which
144fec65c98Schristos.Nm
145fec65c98Schristossearches for manual pages.
146fec65c98SchristosThe supplied
147fec65c98Schristos.Ar path
148fec65c98Schristosmust be a colon
149fec65c98Schristos.Pq Ql \&:
150fec65c98Schristosseparated list of directories.
151fec65c98SchristosThese directories will be searched before the standard directories or
152fec65c98Schristosthe directories specified using the
153fec65c98Schristos.Fl M
154fec65c98Schristosoption or the
155fec65c98Schristos.Ev MANPATH
156fec65c98Schristosenvironment variable.
157fec65c98Schristos.It Fl S Ar subsection
158c9bcef03SchristosOnly show pages for the specified
159fec65c98Schristos.Xr machine 1
160fec65c98Schristosarchitecture.
161fec65c98Schristos.Ar subsection
162fec65c98Schristosis case insensitive.
163fec65c98Schristos.Pp
164fec65c98SchristosBy default manual pages for all architectures are installed.
165fec65c98SchristosTherefore this option can be used to view pages for one
166fec65c98Schristosarchitecture whilst using another.
167fec65c98Schristos.Pp
168fec65c98SchristosThis option overrides the
169fec65c98Schristos.Ev MACHINE
170fec65c98Schristosenvironment variable.
1719ff1f2acSchristos.It Oo Fl s Oc Ar section
1729ff1f2acSchristosOnly select manuals from the specified
1739ff1f2acSchristos.Ar section .
174fec65c98SchristosThe currently available sections are:
175fec65c98Schristos.Pp
176fec65c98Schristos.Bl -tag -width "localXXX" -offset indent -compact
177fec65c98Schristos.It 1
178fec65c98SchristosGeneral commands
179fec65c98Schristos.Pq tools and utilities .
180fec65c98Schristos.It 2
181fec65c98SchristosSystem calls and error numbers.
182fec65c98Schristos.It 3
1839ff1f2acSchristosLibrary functions.
184fec65c98Schristos.It 3p
185fec65c98Schristos.Xr perl 1
186fec65c98Schristosprogrammer's reference guide.
187fec65c98Schristos.It 4
188fec65c98SchristosDevice drivers.
189fec65c98Schristos.It 5
190fec65c98SchristosFile formats.
191fec65c98Schristos.It 6
192fec65c98SchristosGames.
193fec65c98Schristos.It 7
1949ff1f2acSchristosMiscellaneous information.
195fec65c98Schristos.It 8
196fec65c98SchristosSystem maintenance and operation commands.
197fec65c98Schristos.It 9
198fec65c98SchristosKernel internals.
199fec65c98Schristos.El
200c9bcef03Schristos.Pp
201c9bcef03SchristosIf not specified and a match is found in more than one section,
202c9bcef03Schristosthe first match is selected from the following list:
203c9bcef03Schristos1, 8, 6, 2, 3, 5, 7, 4, 9, 3p.
204fec65c98Schristos.It Fl w
205c9bcef03SchristosList the pathnames of all matching manual pages instead of displaying
206c9bcef03Schristosany of them.
207fec65c98Schristos.El
208fec65c98Schristos.Pp
209c9bcef03SchristosThe options
210c9bcef03Schristos.Fl IKOTW
211c9bcef03Schristosare also supported and are documented in
212c9bcef03Schristos.Xr mandoc 1 .
213c9bcef03SchristosThe options
214c9bcef03Schristos.Fl fkl
215c9bcef03Schristosare mutually exclusive and override each other.
216c9bcef03Schristos.Pp
217fec65c98SchristosGuidelines for writing
218fec65c98Schristosman pages can be found in
219fec65c98Schristos.Xr mdoc 7 .
220fec65c98Schristos.Pp
221*544c191cSchristosThe
222*544c191cSchristos.Xr mandoc.db 5
223*544c191cSchristosdatabase is used for looking up manual page entries.
224*544c191cSchristosIn cases where the database is absent, outdated, or corrupt,
225*544c191cSchristos.Nm
226*544c191cSchristosfalls back to looking for files called
227*544c191cSchristos.Ar name . Ns Ar section .
228fec65c98SchristosIf both a formatted and an unformatted version of the same manual page,
229fec65c98Schristosfor example
230fec65c98Schristos.Pa cat1/foo.0
231fec65c98Schristosand
232fec65c98Schristos.Pa man1/foo.1 ,
233c9bcef03Schristosexist in the same directory, only the unformatted version is used.
234*544c191cSchristosThe database is kept up to date with
235*544c191cSchristos.Xr makewhatis 8 ,
236*544c191cSchristoswhich is run by the
237*544c191cSchristos.Xr weekly 8
238*544c191cSchristosmaintenance script.
239fec65c98Schristos.Sh ENVIRONMENT
240fec65c98Schristos.Bl -tag -width MANPATHX
241fec65c98Schristos.It Ev MACHINE
242fec65c98SchristosAs some manual pages are intended only for specific architectures,
243fec65c98Schristos.Nm
244fec65c98Schristossearches any subdirectories,
245fec65c98Schristoswith the same name as the current architecture,
246fec65c98Schristosin every directory which it searches.
247fec65c98SchristosMachine specific areas are checked before general areas.
248fec65c98SchristosThe current machine type may be overridden by setting the environment
249fec65c98Schristosvariable
250fec65c98Schristos.Ev MACHINE
251fec65c98Schristosto the name of a specific architecture,
252fec65c98Schristosor with the
253fec65c98Schristos.Fl S
254fec65c98Schristosoption.
255fec65c98Schristos.Ev MACHINE
256fec65c98Schristosis case insensitive.
257fec65c98Schristos.It Ev MANPAGER
258fec65c98SchristosAny non-empty value of the environment variable
259fec65c98Schristos.Ev MANPAGER
260c9bcef03Schristosis used instead of the standard pagination program,
261fec65c98Schristos.Xr more 1 .
2629ff1f2acSchristosIf
2639ff1f2acSchristos.Xr less 1
2649ff1f2acSchristosis used, the interactive
2659ff1f2acSchristos.Ic :t
2669ff1f2acSchristoscommand can be used to go to the definitions of various terms, for
2679ff1f2acSchristosexample command line options, command modifiers, internal commands,
2689508192eSchristosenvironment variables, function names, preprocessor macros,
2699508192eSchristos.Xr errno 2
2709508192eSchristosvalues, and some other emphasized words.
2719508192eSchristosSome terms may have defining text at more than one place.
2729508192eSchristosIn that case, the
2739508192eSchristos.Xr less 1
2749508192eSchristosinteractive commands
2759508192eSchristos.Ic t
2769508192eSchristosand
2779508192eSchristos.Ic T
2789508192eSchristoscan be used to move to the next and to the previous place providing
2799508192eSchristosinformation about the term last searched for with
2809508192eSchristos.Ic :t .
281*544c191cSchristosThe
282*544c191cSchristos.Fl O Cm tag Ns Op = Ns Ar term
283*544c191cSchristosoption documented in the
284*544c191cSchristos.Xr mandoc 1
285*544c191cSchristosmanual opens a manual page at the definition of a specific
286*544c191cSchristos.Ar term
287*544c191cSchristosrather than at the beginning.
288fec65c98Schristos.It Ev MANPATH
289fec65c98SchristosThe standard search path used by
290fec65c98Schristos.Nm
291c9bcef03Schristosmay be changed by specifying a path in the
292fec65c98Schristos.Ev MANPATH
293c9bcef03Schristosenvironment variable.
294fec65c98SchristosThe format of the path is a colon
295fec65c98Schristos.Pq Ql \&:
296fec65c98Schristosseparated list of directories.
297c9bcef03SchristosInvalid paths are ignored.
298c9bcef03SchristosOverridden by
299c9bcef03Schristos.Fl M ,
300c9bcef03Schristosignored if
301c9bcef03Schristos.Fl l
302c9bcef03Schristosis specified.
303c9bcef03Schristos.Pp
304c9bcef03SchristosIf
305c9bcef03Schristos.Ev MANPATH
306c9bcef03Schristosbegins with a colon, it is appended to the default list;
307c9bcef03Schristosif it ends with a colon, it is prepended to the default list;
308c9bcef03Schristosor if it contains two adjacent colons,
309c9bcef03Schristosthe standard search path is inserted between the colons.
310c9bcef03SchristosIf none of these conditions are met, it overrides the
311c9bcef03Schristosstandard search path.
312fec65c98Schristos.It Ev PAGER
313fec65c98SchristosSpecifies the pagination program to use when
314fec65c98Schristos.Ev MANPAGER
315fec65c98Schristosis not defined.
316fec65c98SchristosIf neither PAGER nor MANPAGER is defined,
3179ff1f2acSchristos.Xr more 1
3189ff1f2acSchristos.Fl s
319c9bcef03Schristosis used.
320fec65c98Schristos.El
321fec65c98Schristos.Sh FILES
322fec65c98Schristos.Bl -tag -width /etc/man.conf -compact
323fec65c98Schristos.It Pa /etc/man.conf
324fec65c98Schristosdefault man configuration file
325fec65c98Schristos.El
326fec65c98Schristos.Sh EXIT STATUS
327fec65c98Schristos.Ex -std man
328c9bcef03SchristosSee
329c9bcef03Schristos.Xr mandoc 1
330c9bcef03Schristosfor details.
331c9bcef03Schristos.Sh EXAMPLES
332c9bcef03SchristosFormat a page for pasting extracts into an email message \(em
333c9bcef03Schristosavoid printing any UTF-8 characters, reduce the width to ease
334c9bcef03Schristosquoting in replies, and remove markup:
335c9bcef03Schristos.Pp
336c9bcef03Schristos.Dl $ man -T ascii -O width=65 pledge | col -b
337c9bcef03Schristos.Pp
338c9bcef03SchristosRead a typeset page in a PDF viewer:
339c9bcef03Schristos.Pp
340c9bcef03Schristos.Dl $ MANPAGER=mupdf man -T pdf lpd
341fec65c98Schristos.Sh SEE ALSO
342fec65c98Schristos.Xr apropos 1 ,
343c9bcef03Schristos.Xr col 1 ,
344c9bcef03Schristos.Xr mandoc 1 ,
345c9bcef03Schristos.Xr ul 1 ,
346fec65c98Schristos.Xr whereis 1 ,
347fec65c98Schristos.Xr man.conf 5 ,
348c9bcef03Schristos.Xr mdoc 7
349fec65c98Schristos.Sh STANDARDS
350fec65c98SchristosThe
351fec65c98Schristos.Nm
352fec65c98Schristosutility is compliant with the
353fec65c98Schristos.St -p1003.1-2008
354fec65c98Schristosspecification.
355fec65c98Schristos.Pp
356fec65c98SchristosThe flags
357fec65c98Schristos.Op Fl aCcfhIKlMmOSsTWw ,
358fec65c98Schristosas well as the environment variables
359fec65c98Schristos.Ev MACHINE ,
360fec65c98Schristos.Ev MANPAGER ,
361fec65c98Schristosand
362fec65c98Schristos.Ev MANPATH ,
363fec65c98Schristosare extensions to that specification.
364fec65c98Schristos.Sh HISTORY
365fec65c98SchristosA
366fec65c98Schristos.Nm
367fec65c98Schristoscommand first appeared in
368fec65c98Schristos.At v3 .
369fec65c98Schristos.Pp
370fec65c98SchristosThe
371fec65c98Schristos.Fl w
372fec65c98Schristosoption first appeared in
373fec65c98Schristos.At v7 ;
374fec65c98Schristos.Fl f
375fec65c98Schristosand
376fec65c98Schristos.Fl k
377fec65c98Schristosin
378fec65c98Schristos.Bx 4 ;
379fec65c98Schristos.Fl M
380fec65c98Schristosin
381fec65c98Schristos.Bx 4.3 ;
382fec65c98Schristos.Fl a
383fec65c98Schristosin
384fec65c98Schristos.Bx 4.3 Tahoe ;
385fec65c98Schristos.Fl c
386fec65c98Schristosand
387fec65c98Schristos.Fl m
388fec65c98Schristosin
389fec65c98Schristos.Bx 4.3 Reno ;
390fec65c98Schristos.Fl h
391fec65c98Schristosin
392fec65c98Schristos.Bx 4.3 Net/2 ;
393fec65c98Schristos.Fl C
394fec65c98Schristosin
395fec65c98Schristos.Nx 1.0 ;
396fec65c98Schristos.Fl s
397fec65c98Schristosand
398fec65c98Schristos.Fl S
399fec65c98Schristosin
4009508192eSchristos.Ox 2.3 ;
4019508192eSchristosand
4029508192eSchristos.Fl I ,
4039508192eSchristos.Fl K ,
4049508192eSchristos.Fl l ,
4059508192eSchristos.Fl O ,
4069508192eSchristosand
4079508192eSchristos.Fl W
4089508192eSchristosin
4099508192eSchristos.Ox 5.7 .
4109508192eSchristosThe
4119508192eSchristos.Fl T
4129508192eSchristosoption first appeared in
4139508192eSchristos.At III
4149508192eSchristosand was also added in
4159508192eSchristos.Ox 5.7 .
416