xref: /netbsd-src/usr.bin/man/man.1 (revision b5677b36047b601b9addaaa494a58ceae82c2a6c)
1.\"	$NetBSD: man.1,v 1.20 2006/04/13 21:10:44 wiz 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 April 10, 2006
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 k
53.Op Fl C Ar file
54.Op Fl M Ar path
55.Op Fl m Ar path
56.Ar keyword Ar ...
57.Sh DESCRIPTION
58The
59.Nm
60utility displays the manual pages named on the command line.
61Its options are as follows:
62.Bl -tag -width indent
63.It Fl a
64Display all of the man pages for a specified
65.Ar section
66and
67.Ar name
68combination.
69(Normally, only the first man page found is displayed.)
70.It Fl C
71Use the specified
72.Ar file
73instead of the default configuration file.
74This permits users to configure their own man environment.
75See
76.Xr man.conf 5
77for a description of the contents of this file.
78.It Fl c
79Copy the man page to the standard output instead of using
80.Xr more 1
81to paginate it.
82This is done by default if the standard output is not a terminal device.
83.It Fl h
84Display only the
85.Dq Tn SYNOPSIS
86lines of the requested man pages.
87For commands, this is typically the command line usage information.
88For library functions, this usually contains the required include
89files and function prototypes.
90.It Fl k
91Display the header lines for any man pages matching
92.Ar keyword Ns Pq s ,
93in the same manner as
94.Xr apropos 1 .
95.It Fl M
96Override the list of standard directories which
97.Nm
98searches for man pages.
99The supplied
100.Ar path
101must be a colon
102.Pq Dq \&:
103separated list of directories.
104This search path may also be set using the environment variable
105.Ev MANPATH .
106The subdirectories to be searched, and their search order,
107is specified by the
108.Dq _subdir
109line in the
110.Nm
111configuration file.
112.It Fl m
113Augment the list of standard directories which
114.Nm
115searches for man pages.
116The supplied
117.Ar path
118must be a colon
119.Pq Dq \&:
120separated list of directories.
121These directories will be searched before the standard directories or
122the directories specified using the
123.Fl M
124option or the
125.Ev MANPATH
126environment variable.
127The subdirectories to be searched, and their search order,
128is specified by the
129.Dq _subdir
130line in the
131.Nm
132configuration file.
133.It Fl s
134Restrict the directories that
135.Nm
136will search to the specified section.
137The
138.Nm
139configuration file (see
140.Xr man.conf 5 )
141specifies the possible
142.Ar section
143values that are currently available.
144.It Fl S
145Display only man pages that have the specified string in the directory
146part of their filenames.
147This allows the man page search process criteria to be
148narrowed without having to change the MANPATH or
149.Dq _default
150variables.
151.It Fl w
152List the pathnames of the man pages which
153.Nm
154would display for the specified
155.Ar section
156and
157.Ar name
158combination.
159.El
160.Pp
161If the
162.Ql Fl s
163option is not specified,
164there is more than one argument,
165the
166.Ql Fl k
167option is not used, and the first argument is a valid section, then that
168argument will be used as if specified by the
169.Ql Fl s
170option.
171.Sh ENVIRONMENT
172.Bl -tag -width MANPATHX
173.It Ev MACHINE
174As some man pages are intended only for specific architectures,
175.Nm
176searches any subdirectories,
177with the same name as the current architecture,
178in every directory which it searches.
179Machine specific areas are checked before general areas.
180The current machine type may be overridden by setting the environment
181variable
182.Ev MACHINE
183to the name of a specific architecture.
184.It Ev MANPATH
185The standard search path used by
186.Nm
187may be overridden by specifying a path in the
188.Ev MANPATH
189environment
190variable.
191The format of the path is a colon
192.Pq Dq \&:
193separated list of directories.
194The subdirectories to be searched as well as their search order
195is specified by the
196.Dq _subdir
197line in the
198.Nm
199configuration file.
200.It Ev PAGER
201The pagination command used for writing the output.
202If the
203.Ev PAGER
204environment variable is null or not set, the standard pagination program
205.Xr more 1
206will be used.
207.El
208.Sh FILES
209.Bl -hang -width /etc/man.conf -compact
210.It Pa /etc/man.conf
211default man configuration file.
212.It Pa /usr/{share,X11R6,pkg,local}/man/whatis.db
213standard whatis/apropos database search path,
214set in
215.Pa /etc/man.conf .
216.El
217.Sh SEE ALSO
218.Xr apropos 1 ,
219.Xr whatis 1 ,
220.Xr whereis 1 ,
221.Xr man.conf 5 ,
222.Xr mdoc 7 ,
223.Xr mdoc.samples 7
224.Sh STANDARDS
225.Nm
226conforms to
227.St -xcu5 .
228.\"and is expected to conform to
229.\".St -p1003.2-?? .
230.Sh BUGS
231The on-line man pages are, by necessity, forgiving toward stupid
232display devices, causing a few man pages to be not as nicely formatted
233as their typeset counterparts.
234