xref: /freebsd/usr.bin/man/man.1 (revision d7149f4e5176e24d02ef4cc3a0636623153209f0)
1.\"-
2.\"  Copyright (c) 2010 Gordon Tetlow
3.\"  All rights reserved.
4.\"
5.\"  Redistribution and use in source and binary forms, with or without
6.\"  modification, are permitted provided that the following conditions
7.\"  are met:
8.\"  1. Redistributions of source code must retain the above copyright
9.\"     notice, this list of conditions and the following disclaimer.
10.\"  2. Redistributions in binary form must reproduce the above copyright
11.\"     notice, this list of conditions and the following disclaimer in the
12.\"     documentation and/or other materials provided with the distribution.
13.\"
14.\"  THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15.\"  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16.\"  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17.\"  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18.\"  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19.\"  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20.\"  OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21.\"  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22.\"  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23.\"  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24.\"  SUCH DAMAGE.
25.\"
26.\" $FreeBSD$
27.\"
28.Dd September 26, 2014
29.Dt MAN 1
30.Os
31.Sh NAME
32.Nm man
33.Nd display online manual documentation pages
34.Sh SYNOPSIS
35.Nm
36.Op Fl adho
37.Op Fl t | w
38.Op Fl M Ar manpath
39.Op Fl P Ar pager
40.Op Fl S Ar mansect
41.Op Fl m Ar arch Ns Op : Ns Ar machine
42.Op Fl p Op Ar eprtv
43.Op Ar mansect
44.Ar page ...
45.Nm
46.Fl f
47.Ar keyword ...
48.Nm
49.Fl k
50.Ar keyword ...
51.Sh DESCRIPTION
52The
53.Nm
54utility finds and displays online manual documentation pages.
55If
56.Ar mansect
57is provided,
58.Nm
59restricts the search to the specific section of the manual.
60.Pp
61The sections of the manual are:
62.Bl -enum -offset indent -compact
63.It
64.Fx
65General Commands Manual
66.It
67.Fx
68System Calls Manual
69.It
70.Fx
71Library Functions Manual
72.It
73.Fx
74Kernel Interfaces Manual
75.It
76.Fx
77File Formats Manual
78.It
79.Fx
80Games Manual
81.It
82.Fx
83Miscellaneous Information Manual
84.It
85.Fx
86System Manager's Manual
87.It
88.Fx
89Kernel Developer's Manual
90.El
91.Pp
92Options that
93.Nm
94understands:
95.Bl -tag -width indent
96.It Fl M Ar manpath
97Forces a specific colon separated manual path instead of the default
98search path.
99See
100.Xr manpath 1 .
101Overrides the
102.Ev MANPATH
103environment variable.
104.It Fl P Ar pager
105Use specified pager.
106Defaults to
107.Dq Li "less -sR"
108if color support is enabled, or
109.Dq Li "more -s" .
110Overrides the
111.Ev MANPAGER
112environment variable, which in turn overrides the
113.Ev PAGER
114environment variable.
115.It Fl S Ar mansect
116Restricts manual sections searched to the specified colon delimited list.
117Defaults to
118.Dq Li 1:8:2:3:n:4:5:6:7:9:l .
119Overrides the
120.Ev MANSECT
121environment variable.
122.It Fl a
123Display all manual pages instead of just the first found for each
124.Ar page
125argument.
126.It Fl d
127Print extra debugging information.
128Repeat for increased verbosity.
129Does not display the manual page.
130.It Fl f
131Emulate
132.Xr whatis 1 .
133.It Fl h
134Display short help message and exit.
135.It Fl k
136Emulate
137.Xr apropos 1 .
138.It Fl m Ar arch Ns Op : Ns Ar machine
139Override the default architecture and machine settings allowing lookup of
140other platform specific manual pages.
141See
142.Sx IMPLEMENTATION NOTES
143for how this option changes the default behavior.
144Overrides the
145.Ev MACHINE_ARCH
146and
147.Ev MACHINE
148environment variables.
149.It Fl o
150Force use of non-localized manual pages.
151See
152.Sx IMPLEMENTATION NOTES
153for how locale specific searches work.
154Overrides the
155.Ev LC_ALL , LC_CTYPE ,
156and
157.Ev LANG
158environment variables.
159.It Fl p Op Cm eprtv
160Use the list of given preprocessors before running
161.Xr nroff 1
162or
163.Xr troff 1 .
164Valid preprocessors arguments:
165.Pp
166.Bl -tag -width indent -compact
167.It Cm e
168.Xr eqn 1
169.It Cm p
170.Xr pic 1
171.It Cm r
172.Xr refer 1
173.It Cm t
174.Xr tbl 1
175.It Cm v
176.Xr vgrind 1
177.El
178.Pp
179Overrides the
180.Ev MANROFFSEQ
181environment variable.
182.It Fl t
183Send manual page source through
184.Xr troff 1
185allowing transformation of the manual pages to other formats.
186.It Fl w
187Display the location of the manual page instead of the contents of
188the manual page.
189.El
190.Sh IMPLEMENTATION NOTES
191.Ss Locale Specific Searches
192The
193.Nm
194utility supports manual pages in different locales.
195The search behavior is dictated by the first of three
196environment variables with a nonempty string:
197.Ev LC_ALL , LC_CTYPE ,
198or
199.Ev LANG .
200If set,
201.Nm
202will search for locale specific manual pages using the following logic:
203.Pp
204.Bl -item -offset indent -compact
205.It
206.Va lang Ns _ Ns Va country Ns . Ns Va charset
207.It
208.Va lang Ns . Ns Va charset
209.It
210.Li en Ns . Ns Va charset
211.El
212.Pp
213For example, if
214.Ev LC_ALL
215is set to
216.Dq Li ja_JP.eucJP ,
217.Nm
218will search the following paths when considering section 1 manual pages in
219.Pa /usr/share/man :
220.Pp
221.Bl -item -offset indent -compact
222.It
223.Pa /usr/share/man/ja_JP.eucJP/man1
224.It
225.Pa /usr/share/man/ja.eucJP/man1
226.It
227.Pa /usr/share/man/en.eucJP/man1
228.It
229.Pa /usr/share/man/man1
230.El
231.Ss Platform Specific Searches
232The
233.Nm
234utility supports platform specific manual pages.
235The search behavior is dictated by the
236.Fl m
237option or the
238.Ev MACHINE_ARCH
239and
240.Ev MACHINE
241environment variables.
242For example, if
243.Ev MACHINE_ARCH
244is set to
245.Dq Li i386
246and
247.Ev MACHINE
248is set to
249.Dq Li pc98 ,
250.Nm
251will search the following paths when considering section 4 manual pages in
252.Pa /usr/share/man :
253.Pp
254.Bl -item -offset indent -compact
255.It
256.Pa /usr/share/man/man4/pc98
257.It
258.Pa /usr/share/man/man4/i386
259.It
260.Pa /usr/share/man/man4
261.El
262.Ss Displaying Specific Manual Files
263The
264.Nm
265utility also supports displaying a specific manual page if passed a path
266to the file as long as it contains a
267.Ql /
268character.
269.Sh ENVIRONMENT
270The following environment variables affect the execution of
271.Nm :
272.Bl -tag -width ".Ev MANROFFSEQ"
273.It Ev LC_ALL , LC_CTYPE , LANG
274Used to find locale specific manual pages.
275Valid values can be found by running the
276.Xr locale 1
277command.
278See
279.Sx IMPLEMENTATION NOTES
280for details.
281Influenced by the
282.Fl o
283option.
284.It Ev MACHINE_ARCH , MACHINE
285Used to find platform specific manual pages.
286If unset, the output of
287.Dq Li "sysctl hw.machine_arch"
288and
289.Dq Li "sysctl hw.machine"
290is used respectively.
291See
292.Sx IMPLEMENTATION NOTES
293for details.
294Corresponds to the
295.Fl m
296option.
297.It Ev MANPATH
298Used to find the location of the manual files.
299See
300.Xr manpath 1
301for additional information.
302Corresponds to the
303.Fl M
304option.
305.It Ev MANROFFSEQ
306Used to determine the preprocessors for the manual source before running
307.Xr nroff 1
308or
309.Xr troff 1 .
310If unset, defaults to
311.Xr tbl 1 .
312Corresponds to the
313.Fl p
314option.
315.It Ev MANSECT
316Restricts manual sections searched to the specified colon delimited list.
317Corresponds to the
318.Fl S
319option.
320.It Ev MANWIDTH
321If set to a numeric value, used as the width manpages should be displayed.
322Otherwise, if set to a special value
323.Dq Li tty ,
324and output is to a terminal,
325the pages may be displayed over the whole width of the screen.
326.It Ev MANCOLOR
327If set, enables color support.
328.It Ev MANPAGER
329Program used to display files.
330.Pp
331If unset, and color support is enabled,
332.Dq Li "less -sR"
333is used.
334.Pp
335If unset, and color support is disabled, then
336.Ev PAGER
337is used.
338If that has no value either,
339.Dq Li "more -s"
340is used.
341.El
342.Sh FILES
343.Bl -tag -width indent -compact
344.It Pa /etc/man.conf
345System configuration file.
346.It Pa /usr/local/etc/man.d/*.conf
347Local configuration files.
348.El
349.Sh SEE ALSO
350.Xr apropos 1 ,
351.Xr intro 1 ,
352.Xr locale 1 ,
353.Xr manpath 1 ,
354.Xr nroff 1 ,
355.Xr troff 1 ,
356.Xr whatis 1 ,
357.Xr intro 2 ,
358.Xr intro 3 ,
359.Xr intro 4 ,
360.Xr intro 5 ,
361.Xr man.conf 5 ,
362.Xr intro 6 ,
363.Xr intro 7 ,
364.Xr intro 8 ,
365.Xr intro 9
366