OSDN Git Service

8a82394fe8607d9c18cd4792b23d6e65a4379ac9
[linuxjm/jm.git] / manual / man / original / man1 / man.1
1 .\"
2 .\" Generated automatically from man.1.in by the
3 .\" configure script.
4 .\"
5 .\" Man page for man (and the former manpath)
6 .\"
7 .\" Copyright (c) 1990, 1991, John W. Eaton.
8 .\"
9 .\" You may distribute under the terms of the GNU General Public
10 .\" License as specified in the README file that comes with the man 1.0
11 .\" distribution.  
12 .\"
13 .\" John W. Eaton
14 .\" jwe@che.utexas.edu
15 .\" Department of Chemical Engineering
16 .\" The University of Texas at Austin
17 .\" Austin, Texas  78712
18 .\"
19 .\" Many changes - aeb
20 .\"
21 .TH man 1 "September 2, 1995"
22 .LO 1
23 .SH NAME
24 man \- format and display the on-line manual pages
25 .br
26 manpath \- determine user's search path for man pages
27 .SH SYNOPSIS
28 .B man 
29 .RB [ \-acdfFhkKtwW ]
30 .RB [ --path ] 
31 .RB [ \-m 
32 .IR system ] 
33 .RB [ \-p 
34 .IR string ] 
35 .RB [ \-C 
36 .IR config_file ] 
37 .RB [ \-M 
38 .IR pathlist ]
39 .RB [ \-P
40 .IR pager ] 
41 .RB [ \-S 
42 .IR section_list ] 
43 .RI [ section ] 
44 .I "name ..."
45
46 .SH DESCRIPTION
47 .B man
48 formats and displays the on-line manual pages.  If you specify
49 .IR section ,
50 .B man
51 only looks in that section of the manual.
52 .I name
53 is normally the name of the manual page, which is typically the name
54 of a command, function, or file.  
55 However, if
56 .I name
57 contains a slash
58 .RB ( / ) 
59 then 
60 .B man 
61 interprets it as a file specification, so that you can do
62 .B "man ./foo.5"
63 or even
64 .B "man /cd/foo/bar.1.gz\fR.\fP"
65 .PP
66 See below for a description of where 
67 .B man
68 looks for the manual page files.
69  
70 .SH OPTIONS
71 .TP
72 .B \-\^C " config_file"
73 Specify the configuration file to use; the default is
74 .BR /usr/share/misc/man.conf .
75 (See
76 .BR man.conf (5).)
77 .TP
78 .B \-\^M " path"
79 Specify the list of directories to search for man pages.
80 Separate the directories with colons.  An empty list is the same as
81 not specifying 
82 .B \-M
83 at all.  See
84 .BR "SEARCH PATH FOR MANUAL PAGES" .
85 .TP
86 .B \-\^P " pager"
87 Specify which pager to use. 
88 This option overrides the
89 .B MANPAGER
90 environment variable, which in turn overrides the
91 .B PAGER
92 variable.  By default,
93 .B man
94 uses
95 .BR "/usr/bin/less -is" .
96 .TP
97 .B \-\^S " section_list"
98 List is a colon separated list of manual sections to search.
99 This option overrides the
100 .B MANSECT
101 environment variable.
102 .TP
103 .B \-\^a
104 By default,
105 .B man
106 will exit after displaying the first manual page it
107 finds.  Using this option forces
108 .B man
109 to display all the manual pages that match
110 .B name, 
111 not just the first.
112 .TP
113 .B \-\^c
114 Reformat the source man page, even when an up-to-date cat page exists.
115 This can be meaningful if the cat page was formatted for a screen
116 with a different number of columns, or if the preformatted page
117 is corrupted.
118 .TP
119 .B \-\^d
120 Don't actually display the man pages, but do print gobs of debugging
121 information.
122 .TP
123 .B \-\^D
124 Both display and print debugging info.
125 .TP
126 .B \-\^f
127 Equivalent to
128 .BR whatis .
129 .TP
130 .BR \-\^F " or " \-\-preformat
131 Format only - do not display.
132 .TP
133 .B \-\^h
134 Print a one-line help message and exit.
135 .TP
136 .B \-\^k
137 Equivalent to
138 .BR apropos .
139 .TP
140 .B \-\^K
141 Search for the specified string in *all* man pages. Warning: this is
142 probably very slow! It helps to specify a section.
143 (Just to give a rough idea, on my machine this takes about a minute
144 per 500 man pages.)
145 .TP
146 .B \-\^m " system"
147 Specify an alternate set of man pages to search based on the system
148 name given.
149 .TP
150 .B \-\^p " string"
151 Specify the sequence of preprocessors to run before
152 .B nroff
153 or
154 .BR troff .
155 Not all installations will have a full set of preprocessors.
156 Some of the preprocessors and the letters used to designate them are: 
157 eqn (e), grap (g), pic (p), tbl (t), vgrind (v), refer (r).
158 This option overrides the
159 .B MANROFFSEQ
160 environment variable.
161 .TP
162 .B \-\^t
163 Use
164 .B /usr/bin/groff -Tps -mandoc
165 to format the manual page, passing the output to 
166 .B stdout.
167 The output from
168 .B /usr/bin/groff -Tps -mandoc
169 may need to be passed through some filter or another before being
170 printed.
171 .TP
172 .B \-\^w \fRor\fP \-\-path
173 Don't actually display the man pages, but do print the location(s) of
174 the files that would be formatted or displayed. If no argument is given:
175 display (on stdout) the list of directories that is searched by
176 .B man
177 for man pages. If
178 .B manpath
179 is a link to man, then "manpath" is equivalent to "man --path".
180 .TP
181 .B \-\^W
182 Like \-\^w, but print file names one per line, without additional information.
183 This is useful in shell commands like
184 .ft CW
185 .B "man -aW man | xargs ls -l"
186 .ft
187
188 .SH "CAT PAGES"
189 Man will try to save the formatted man pages, in order to save
190 formatting time the next time these pages are needed.
191 Traditionally, formatted versions of pages in DIR/manX are
192 saved in DIR/catX, but other mappings from man dir to cat dir
193 can be specified in
194 .BR /usr/share/misc/man.conf .
195 No cat pages are saved when the required cat directory does not exist.
196 No cat pages are saved when they are formatted for a line length
197 different from 80.
198 No cat pages are saved when man.conf contains the line NOCACHE.
199 .PP
200 It is possible to make
201 .B man
202 suid to a user man. Then, if a cat directory
203 has owner man and mode 0755 (only writable by man), and the cat files
204 have owner man and mode 0644 or 0444 (only writable by man, or not
205 writable at all), no ordinary user can change the cat pages or put
206 other files in the cat directory. If
207 .B man
208 is not made suid, then a cat directory should have mode 0777
209 if all users should be able to leave cat pages there.
210 .PP
211 The option
212 .B \-c
213 forces reformatting a page, even if a recent cat page exists.
214
215
216 .SH "SEARCH PATH FOR MANUAL PAGES"
217 .B man
218 uses a sophisticated method of finding manual page files, based on the
219 invocation options and environment variables, the 
220 .B /usr/share/misc/man.conf 
221 configuration file, and some built in conventions and heuristics.
222 .PP
223 First of all, when the 
224 .I name
225 argument to 
226 .B man
227 contains a slash 
228 .RB ( / ),
229 .B man
230 assumes it is a file specification itself,
231 and there is no searching involved.
232 .PP
233 But in the normal case where 
234 .I name
235 doesn't contain a slash,
236 .B man
237 searches a variety of directories for a file that could be a manual page
238 for the topic named.
239 .PP
240 If you specify the 
241 .BI "-M " pathlist
242 option,
243 .I pathlist 
244 is a colon-separated list of the directories that 
245 .B man 
246 searches.
247 .PP
248 If you don't specify
249 .B -M
250 but set the
251 .B MANPATH
252 environment variable, the value of that variable is the list of the 
253 directories that 
254 .B man
255 searches.
256 .PP
257 If you don't specify an explicit path list with 
258 .B -M
259 or 
260 .BR MANPATH ,
261 .B man
262 develops its own path list based on the contents of the configuration 
263 file
264 .BR /usr/share/misc/man.conf .
265 The
266 .B MANPATH
267 statements in the configuration file identify particular directories to 
268 include in the search path.
269 .PP
270 Furthermore, the 
271 .B MANPATH_MAP 
272 statements add to the search path depending on your command search path
273 (i.e. your
274 .B PATH 
275 environment variable).  For each directory that may be in the command
276 search path, a
277 .B MANPATH_MAP
278 statement specifies a directory that should be added to the search
279 path for manual page files.
280 .B man
281 looks at the 
282 .B PATH
283 variable and adds the corresponding directories to the manual page
284 file search path.  Thus, with the proper use of
285 .BR MANPATH_MAP ,
286 when you issue the command
287 .BR "man xyz" ,
288 you get a manual page for the program that would run if you issued the
289 command 
290 .BR xyz .
291 .PP
292 In addition, for each directory in the command search path (we'll call
293 it a "command directory") for which you do
294 .I not
295 have a 
296 .B MANPATH_MAP 
297 statement,
298 .B man
299 automatically looks for a manual page directory "nearby"
300 namely as a subdirectory in the command directory itself or
301 in the parent directory of the command directory.
302 .PP
303 You can disable the automatic "nearby" searches by including a
304 .B NOAUTOPATH
305 statement in 
306 .BR /usr/share/misc/man.conf .
307 .PP
308 In each directory in the search path as described above, 
309 .B man
310 searches for a file named
311 .IB topic . section\fR,
312 with an optional suffix on the section number and 
313 possibly a compression suffix.
314 If it doesn't find such a file, it then looks in any subdirectories
315 named
316 .BI man N
317 or 
318 .BI cat N
319 where
320 .I N
321 is the manual section number.
322 If the file is in a 
323 .BI cat N
324 subdirectory, 
325 .B man
326 assumes it is a formatted manual page file (cat page).  Otherwise,
327 .B man
328 assumes it is unformatted.  In either case, if the filename has a
329 known compression suffix (like
330 .BR .gz ),
331 .B man
332 assumes it is gzipped.
333 .PP
334 If you want to see where (or if)
335 .B man
336 would find the manual page for a particular topic, use the 
337 .BR "--path " ( -w )
338 option.
339
340 .SH ENVIRONMENT
341 .TP
342 .B MANPATH
343 If
344 .B MANPATH
345 is set, 
346 .B man
347 uses it as the path to search for manual page files.  It overrides the
348 configuration file and the automatic search path, but is overridden by
349 the
350 .B -M
351 invocation option.  See 
352 .BR "SEARCH PATH FOR MANUAL PAGES" .
353 .TP
354 .B MANPL
355 If
356 .B MANPL
357 is set, its value is used as the display page length.
358 Otherwise, the entire man page will occupy one (long) page.
359 .TP
360 .B MANROFFSEQ
361 If
362 .B MANROFFSEQ
363 is set, its value is used to determine the set of preprocessors run
364 before running
365 .B nroff
366 or
367 .BR troff .
368 By default, pages are passed through
369 the tbl preprocessor before
370 .BR nroff .
371 .TP
372 .B MANSECT
373 If
374 .B MANSECT
375 is set, its value is used to determine which manual sections to search.
376 .TP
377 .B MANWIDTH
378 If
379 .B MANWIDTH
380 is set, its value is used as the width manpages should be displayed.
381 Otherwise the pages may be displayed over the whole width of your
382 screen.
383 .TP
384 .B MANPAGER
385 If
386 .B MANPAGER
387 is set, its value is used as the name of the program to use to display
388 the man page.  If not, then
389 .B PAGER
390 is used. If that has no value either,
391 .B /usr/bin/less -is
392 is used.
393 .TP
394 .B LANG
395 If
396 .B LANG
397 is set, its value defines the name of the subdirectory where man
398 first looks for man pages. Thus, the command `LANG=dk man 1 foo'
399 will cause man to look for the foo man page in .../dk/man1/foo.1,
400 and if it cannot find such a file, then in .../man1/foo.1,
401 where ... is a directory on the search path.
402 .TP
403 .B "NLSPATH, LC_MESSAGES, LANG"
404 The environment variables
405 .B NLSPATH
406 and
407 .B LC_MESSAGES
408 (or
409 .B LANG
410 when the latter does not exist)
411 play a role in locating the message catalog.
412 (But the English messages are compiled in, and for English no catalog
413 is required.)
414 Note that programs like
415 .BR col(1)
416 called by man also use e.g. LC_CTYPE.
417 .TP
418 .B PATH
419 .B PATH
420 helps determine the search path for manual page files.  See
421 .BR "SEARCH PATH FOR MANUAL PAGES" .
422 .TP
423 .B SYSTEM
424 .B SYSTEM
425 is used to get the default alternate system name (for use
426 with the
427 .B \-m
428 option). 
429 .SH "SEE ALSO"
430 apropos(1), whatis(1), less(1), groff(1), man.conf(5).
431 .SH BUGS
432 The
433 .B \-t
434 option only works if a troff-like program is installed.
435 .br
436 If you see blinking \e255 or <AD> instead of hyphens,
437 put `LESSCHARSET=latin1' in your environment.
438 .SH TIPS
439 If you add the line
440
441   (global-set-key [(f1)] (lambda () (interactive) (manual-entry (current-word))))
442
443 to your
444 .IR .emacs 
445 file, then hitting F1 will give you the man page for the library call
446 at the current cursor position.
447 .LP
448 To get a plain text version of a man page, without backspaces
449 and underscores, try
450
451   # man foo | col -b > foo.mantxt
452