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