Initial import from FreeBSD RELENG_4:
[dragonfly.git] / gnu / usr.bin / man / man / man.man
1 .\" Man page for man
2 .\"
3 .\" Copyright (c) 1990, 1991, John W. Eaton.
4 .\"
5 .\" You may distribute under the terms of the GNU General Public
6 .\" License as specified in the README file that comes with the man 1.0
7 .\" distribution.  
8 .\"
9 .\" John W. Eaton
10 .\" jwe@che.utexas.edu
11 .\" Department of Chemical Engineering
12 .\" The University of Texas at Austin
13 .\" Austin, Texas  78712
14 .\"
15 .\" $FreeBSD: src/gnu/usr.bin/man/man/man.man,v 1.10.2.8 2002/06/25 00:02:55 eric Exp $
16 .\"
17 .Dd January 5, 1991
18 .Dt MAN 1
19 .Os
20 .Sh NAME
21 .Nm man
22 .Nd format and display the on-line manual pages
23 .Sh SYNOPSIS
24 .Nm
25 .Op Fl adfhkotw
26 .Op Fl m Ar machine
27 .Op Fl p Ar string
28 .Op Fl M Ar path
29 .Op Fl P Ar pager
30 .Op Fl S Ar list
31 .Op Ar section
32 .Ar name ...
33 .Sh DESCRIPTION
34 .Nm Man
35 formats and displays the on-line manual pages.  This version knows
36 about the
37 .Ev MANPATH
38 and
39 .Ev PAGER
40 environment variables, so you can have
41 your own set(s) of personal man pages and choose whatever program you
42 like to display the formatted pages.  If section is specified,
43 .Nm
44 only looks in that section of the manual.  You may also specify the
45 order to search the sections for entries and which preprocessors to
46 run on the source files via command line options or environment
47 variables.  If enabled by the system administrator, formatted man
48 pages will also be compressed with the `%compress%' command to save
49 space.
50 .Pp
51 The options are as follows:
52 .Bl -tag -width Fl
53 .It Fl M Ar path
54 Specify an alternate manpath.
55 By default,
56 .Nm
57 uses
58 .Xr manpath 1
59 (which is built into the
60 .Nm
61 binary)
62 to determine the path to search.  This option overrides the
63 .Ev MANPATH
64 environment variable.
65 .It Fl P Ar pager
66 Specify which pager to use.
67 By default,
68 .Nm
69 uses
70 .Nm %pager% .
71 This option overrides the
72 .Ev PAGER
73 environment variable.
74 .It Fl S Ar list
75 List is a colon separated list of manual sections to search.
76 This option overrides the
77 .Ev MANSECT
78 environment variable.
79 .It Fl a
80 By default,
81 .Nm
82 will exit after displaying the first manual page it
83 finds.  Using this option forces
84 .Nm
85 to display all the manual pages
86 that match
87 .Ar name ,
88 not just the first.
89 .It Fl d
90 Don't actually display the man pages, but do print gobs of debugging
91 information.
92 .It Fl f
93 Equivalent to
94 .Nm whatis .
95 .It Fl h
96 Print a help message and exit.
97 .It Fl k
98 Equivalent to
99 .Nm apropos .
100 .It Fl m Ar machine
101 As some manual pages are intended only for specific architectures,
102 .Nm
103 searches any subdirectories,
104 with the same name as the current architecture,
105 in every directory which it searches.
106 Machine specific areas are checked before general areas.
107 The current machine type may be overridden using this option
108 or by setting the environment variable
109 .Ev MACHINE
110 to the name of a specific architecture.
111 This option overrides the
112 .Ev MACHINE
113 environment variable.
114 .It Fl o
115 Look for original, non-localized manpages only.
116 .Pp
117 By default,
118 .Nm
119 searches for a localized manpage
120 in a set of locale subdirectories of each
121 .Xr manpath 1
122 component.
123 .Pp
124 Locale name is taken from the first of three environment variables
125 with a nonempty value:
126 .Ev LC_ALL , LC_CTYPE ,
127 or
128 .Ev LANG ,
129 in the specified order.
130 .Pp
131 If the value could not be determined, or is not a valid locale name,
132 then only non-localized manpage will be looked up.
133 .Pp
134 Otherwise,
135 .Nm
136 will search in the following subdirectories, in the order of precedence:
137 .Pp
138 .Bl -item -offset indent -compact
139 .Sm off
140 .It
141 .Pa <lang> _ <country> . <charset>
142 .It
143 .Pa <lang> . <charset>
144 .It
145 .Pa en . <charset>
146 .Sm on
147 .El
148 .Pp
149 For example, for
150 .Dq de_DE.ISO8859-1
151 locale,
152 .Nm
153 will search in the following subdirectories of the
154 .Pa /usr/share/man
155 manpath component:
156 .Pp
157 .Bl -item -offset indent -compact
158 .It
159 .Pa /usr/share/man/de_DE.ISO8859-1
160 .It
161 .Pa /usr/share/man/de.ISO8859-1
162 .It
163 .Pa /usr/share/man/en.ISO8859-1
164 .El
165 .Pp
166 Finally,
167 if the search of localized manpage fails,
168 it will be looked up in the default
169 .Pa /usr/share/man
170 directory.
171 .It Fl p Ar string
172 Specify the sequence of preprocessors to run before nroff or troff.
173 Not all installations will have a full set of preprocessors.
174 Some of the preprocessors and the letters used to designate them are: 
175 eqn (e), grap (g), pic (p), tbl (t), vgrind (v), refer (r).
176 This option overrides the
177 .Ev MANROFFSEQ
178 environment variable.
179 .It Fl t
180 Use
181 .Nm %troff%
182 to format the manual page, passing the output to stdout.
183 The output from
184 .Nm %troff%
185 may need to be passed through some filter or another before being
186 printed.
187 .It Fl w
188 Don't actually display the man pages, but do print the location(s) of
189 the files that would be formatted or displayed.
190 .El
191 .Sh ENVIRONMENT
192 .Bl -tag -width MANROFFSEQ
193 .It Ev LC_ALL , LC_CTYPE , LANG
194 These variables specify the preferred language for manual pages.
195 (See the
196 .Fl o
197 option above.)
198 .It Ev MACHINE
199 If
200 .Ev MACHINE
201 is set, its value is used to override the current machine type
202 when searching machine specific subdirectories.
203 .It Ev MANPATH
204 If
205 .Ev MANPATH
206 is set, its value is used as the path to search for manual pages.
207 .It Ev MANROFFSEQ
208 If
209 .Ev MANROFFSEQ
210 is set, its value is used to determine the set of preprocessors run
211 before running nroff or troff.  By default, pages are passed through
212 the table preprocessor before nroff.
213 .It Ev MANSECT
214 If
215 .Ev MANSECT
216 is set, its value is used to determine which manual sections to search.
217 .It Ev PAGER
218 If
219 .Ev PAGER
220 is set, its value is used as the name of the program to use to display
221 the man page.  By default,
222 .Nm %pager%
223 is used.
224 .El
225 .Sh EXAMPLES
226 .Pp
227 Normally, to look at the relevant manpage information for getopt,
228 one would use:
229 .Pp
230 .Dl man getopt
231 .Pp
232 However, when referring to a specific section of the manual,
233 such as
234 .Xr getopt 3 ,
235 one would use:
236 .Pp
237 .Dl man 3 getopt
238 .Sh SEE ALSO
239 .Xr apropos 1 ,
240 .Xr groff 1 ,
241 .Xr manpath 1 ,
242 .Xr more 1 ,
243 .Xr whatis 1 ,
244 .Xr man 7 ,
245 .Xr mdoc 7
246 .Sh BUGS
247 The
248 .Fl t
249 option only works if the
250 .Xr troff 1 Ns -like
251 program is installed.