xref: /netbsd-src/usr.bin/man/man.1 (revision deb6f0161a9109e7de9b519dc8dfb9478668dcdd)
1.\"	$NetBSD: man.1,v 1.29 2016/06/16 15:10:58 abhinav Exp $
2.\"
3.\" Copyright (c) 1989, 1990, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors
15.\"    may be used to endorse or promote products derived from this software
16.\"    without specific prior written permission.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE.
29.\"
30.\"     @(#)man.1	8.2 (Berkeley) 1/2/94
31.\"
32.Dd June 16, 2016
33.Dt MAN 1
34.Os
35.Sh NAME
36.Nm man
37.Nd display the on-line manual pages
38.Pq aka Dq Em man pages
39.Sh SYNOPSIS
40.Nm
41.Oo Fl acw Ns \&| Ns Fl h Oc
42.Op Fl C Ar file
43.Op Fl M Ar path
44.Op Fl m Ar path
45.Op Fl S Ar srch
46.Oo
47.Op Fl s
48.Ar section
49.Oc
50.Ar name Ar ...
51.Nm
52.Op Fl C Ar file
53.Fl f
54.Ar command Ar ...
55.Nm
56.Op Fl C Ar file
57.Fl k
58.Ar keyword Ar ...
59.Nm
60.Fl p
61.Sh DESCRIPTION
62The
63.Nm
64utility displays the manual pages named on the command line.
65Its options are as follows:
66.Bl -tag -width indent
67.It Fl a
68Display all of the man pages for a specified
69.Ar section
70and
71.Ar name
72combination.
73(Normally, only the first man page found is displayed.)
74.It Fl C
75Use the specified
76.Ar file
77instead of the default configuration file.
78This permits users to configure their own man environment.
79See
80.Xr man.conf 5
81for a description of the contents of this file.
82.It Fl c
83Copy the man page to the standard output instead of using
84.Xr more 1
85to paginate it.
86This is done by default if the standard output is not a terminal device.
87.It Fl f
88Synonym for
89.Xr whatis 1 .
90It searches man pages for
91.Ar command
92in their names and displays header lines from all matching pages.
93.It Fl h
94Display only the
95.Dq Tn SYNOPSIS
96lines of the requested man pages.
97For commands, this is typically the command line usage information.
98For library functions, this usually contains the required include
99files and function prototypes.
100.It Fl k
101Search man pages for
102.Ar keyword Ns Pq s ,
103in the same manner as
104.Xr apropos 1 .
105.It Fl M
106Override the list of standard directories which
107.Nm
108searches for man pages.
109The supplied
110.Ar path
111must be a colon
112.Pq Dq \&:
113separated list of directories.
114This search path may also be set using the environment variable
115.Ev MANPATH .
116The subdirectories to be searched, and their search order,
117is specified by the
118.Dq _subdir
119line in the
120.Nm
121configuration file.
122.It Fl m
123Augment the list of standard directories which
124.Nm
125searches for man pages.
126The supplied
127.Ar path
128must be a colon
129.Pq Dq \&:
130separated list of directories.
131These directories will be searched before the standard directories or
132the directories specified using the
133.Fl M
134option or the
135.Ev MANPATH
136environment variable.
137The subdirectories to be searched, and their search order,
138is specified by the
139.Dq _subdir
140line in the
141.Nm
142configuration file.
143.It Fl p
144Print the search path for the manual pages.
145.It Fl s
146Restrict the directories that
147.Nm
148will search to the specified section.
149The
150.Nm
151configuration file (see
152.Xr man.conf 5 )
153specifies the possible
154.Ar section
155values that are currently available.
156.It Fl S
157Display only man pages that have the specified string in the directory
158part of their filenames.
159This allows the man page search process criteria to be
160narrowed without having to change the MANPATH or
161.Dq _default
162variables.
163.It Fl w
164List the pathnames of the man pages which
165.Nm
166would display for the specified
167.Ar section
168and
169.Ar name
170combination.
171.El
172.Pp
173If the
174.Ql Fl s
175option is not specified,
176there is more than one argument,
177the
178.Ql Fl k
179option is not used, and the first argument is a valid section, then that
180argument will be used as if specified by the
181.Ql Fl s
182option.
183.Pp
184If
185.Ar name
186is given with a full path (beginning with
187.Ql Pa \&/ )
188or a relative path that begins with
189.Ql Pa .\&/
190or
191.Ql Pa .\&./ ,
192then
193.Nm
194interprets it as a file specification, so that you can do
195.Nm
196.Cm ./foo.5
197or even
198.Nm
199.Cm /cd/foo/bar.1.gz .
200If
201.Ar name
202contains
203.Ql Pa /
204but does not match one of the above cases, then the
205search path is used; this allows you to request
206machine-specific man pages, such as
207.Nm Cm vax/boot .
208.Sh ENVIRONMENT
209.Bl -tag -width MANPATHX
210.It Ev MACHINE
211As some man pages are intended only for specific architectures,
212.Nm
213searches any subdirectories,
214with the same name as the current architecture,
215in every directory which it searches.
216Machine specific areas are checked before general areas.
217The current machine type may be overridden by setting the environment
218variable
219.Ev MACHINE
220to the name of a specific architecture.
221Machine-specific man pages may also be requested by
222prepending the relevant subdirectory name to the page name,
223separated by
224.Ql Pa \&/ .
225.It Ev MANPATH
226The standard search path used by
227.Nm
228may be overridden by specifying a path in the
229.Ev MANPATH
230environment variable.
231The format of the path is a colon
232.Pq Dq \&:
233separated list of directories.
234The subdirectories to be searched as well as their search order
235is specified by the
236.Dq _subdir
237line in the
238.Nm
239configuration file.
240.It Ev PAGER
241The pagination command used for writing the output.
242If the
243.Ev PAGER
244environment variable is null or not set, the standard pagination program
245.Xr more 1
246will be used.
247.El
248.Sh FILES
249.Bl -hang -width /etc/man.conf -compact
250.It Pa /etc/man.conf
251default man configuration file.
252.El
253.Sh SEE ALSO
254.Xr apropos 1 ,
255.Xr whatis 1 ,
256.Xr whereis 1 ,
257.Xr man.conf 5 ,
258.Xr mdoc 7 ,
259.Xr mdoc.samples 7
260.Sh STANDARDS
261.Nm
262conforms to
263.St -xcu5 .
264.\"and is expected to conform to
265.\".St -p1003.2-?? .
266.Sh BUGS
267The on-line man pages are, by necessity, forgiving toward stupid
268display devices, causing a few man pages to be not as nicely formatted
269as their typeset counterparts.
270