1man(1)                      General Commands Manual                     man(1)
2
3
4

NAME

6       man - format and display the on-line manual pages
7

SYNOPSIS

9       man [-acdDfFhkKtvVwW] [--path] [-m system] [-p string] [-C config_file]
10       [-M pathlist] [-P pager] [-B browser] [-H htmlpager] [-S  section_list]
11       [section] name ...
12
13

DESCRIPTION

15       man formats and displays the on-line manual pages.  If you specify sec‐
16       tion, man only looks in that section of the manual.  name  is  normally
17       the  name of the manual page, which is typically the name of a command,
18       function, or file.  However, if name contains  a  slash  (/)  then  man
19       interprets  it  as a file specification, so that you can do man ./foo.5
20       or even man /cd/foo/bar.1.gz.
21
22       See below for a description of where man  looks  for  the  manual  page
23       files.
24
25

MANUAL SECTIONS

27       The standard sections of the manual include:
28
29       1      User Commands
30
31       2      System Calls
32
33       3      C Library Functions
34
35       4      Devices and Special Files
36
37       5      File Formats and Conventions
38
39       6      Games et. Al.
40
41       7      Miscellanea
42
43       8      System Administration tools and Daemons
44
45       Distributions  customize  the  manual section to their specifics, which
46       often include additional sections.
47
48

OPTIONS

50       -C  config_file
51              Specify  the  configuration  file  to  use;   the   default   is
52              /etc/man.config.  (See man.config(5).)
53
54       -M  path
55              Specify  the list of directories to search for man pages.  Sepa‐
56              rate the directories with colons.  An empty list is the same  as
57              not specifying -M at all.  See SEARCH PATH FOR MANUAL PAGES.
58
59       -P  pager
60              Specify  which pager to use.  This option overrides the MANPAGER
61              environment variable, which in turn overrides  the  PAGER  vari‐
62              able.  By default, man uses /usr/bin/less -is.
63
64       -B     Specify  which  browser to use on HTML files.  This option over‐
65              rides the BROWSER environment variable.  By  default,  man  uses
66              /usr/bin/less-is,
67
68       -H     Specify  a command that renders HTML files as text.  This option
69              overrides the HTMLPAGER environment variable.  By  default,  man
70              uses /bin/cat,
71
72       -S  section_list
73              List  is  a  colon  separated list of manual sections to search.
74              This option overrides the MANSECT environment variable.
75
76       -a     By default, man will exit after displaying the first manual page
77              it  finds.  Using this option forces man to display all the man‐
78              ual pages that match name, not just the first.
79
80       -c     Reformat the source man page, even when an up-to-date  cat  page
81              exists.   This  can  be meaningful if the cat page was formatted
82              for a screen with a different number of columns, or if the  pre‐
83              formatted page is corrupted.
84
85       -d     Don't  actually  display  the  man  pages,  but do print gobs of
86              debugging information.
87
88       -D     Both display and print debugging info.
89
90       -f     Equivalent to whatis.
91
92       -F or --preformat
93              Format only - do not display.
94
95       -h or --help
96              Print a help message and exit.
97
98       -v, -V or --version
99              Print version information and exit.
100
101       -k     Equivalent to apropos.
102
103       -K     Search for the specified string in  *all*  man  pages.  Warning:
104              this  is  probably  very  slow!  It  helps to specify a section.
105              (Just to give a rough idea, on my machine  this  takes  about  a
106              minute per 500 man pages.)
107
108       -m  system
109              Specify  an  alternate  set  of man pages to search based on the
110              system name given.
111
112       -p  string
113              Specify the sequence of preprocessors to  run  before  nroff  or
114              troff.  Not all installations will have a full set of preproces‐
115              sors.  Some of the preprocessors and the letters used to  desig‐
116              nate  them are: eqn (e), grap (g), pic (p), tbl (t), vgrind (v),
117              refer (r).  This option  overrides  the  MANROFFSEQ  environment
118              variable.
119
120       -t     Use /usr/bin/groff -Tps -mandoc to format the manual page, pass‐
121              ing  the  output  to  stdout.   The  default  output  format  of
122              /usr/bin/groff  -Tps  -mandoc is Postscript, refer to the manual
123              page of /usr/bin/groff -Tps -mandoc for ways to pick  an  alter‐
124              nate format.
125
126       Depending  on  the  selected  format  and  the availability of printing
127       devices, the output may need  to  be  passed  through  some  filter  or
128       another before being printed.
129
130       -w or --path
131              Don't  actually  display  the  man pages, but do print the loca‐
132              tion(s) of the files that would be formatted or displayed. If no
133              argument  is  given: display (on stdout) the list of directories
134              that is searched by man for man pages. If manpath is a  link  to
135              man, then "manpath" is equivalent to "man --path".
136
137       -W     Like  -w,  but print file names one per line, without additional
138              information.  This is useful in shell commands like man -aW  man
139              | xargs ls -l
140
141

CAT PAGES

143       Man  will try to save the formatted man pages, in order to save format‐
144       ting time the next time these pages are needed.  Traditionally, format‐
145       ted versions of pages in DIR/manX are saved in DIR/catX, but other map‐
146       pings from man dir to cat dir can be specified in /etc/man.config.   No
147       cat pages are saved when the required cat directory does not exist.  No
148       cat pages are saved when they are formatted for a line length different
149       from  80.   No  cat  pages  are saved when man.config contains the line
150       NOCACHE.
151
152       It is possible to make man suid to a user man. Then, if a cat directory
153       has  owner  man and mode 0755 (only writable by man), and the cat files
154       have owner man and mode 0644 or 0444 (only  writable  by  man,  or  not
155       writable  at  all),  no  ordinary  user can change the cat pages or put
156       other files in the cat directory. If man is not made suid, then  a  cat
157       directory  should  have  mode 0777 if all users should be able to leave
158       cat pages there.
159
160       The option -c forces reformatting a page, even if  a  recent  cat  page
161       exists.
162
163

HTML PAGES

165       Man  will find HTML pages if they live in directories named as expected
166       to be ".html", thus a valid name for an HTML version of the  ls(1)  man
167       page would be /usr/share/man/htmlman1/ls.1.html.
168
169

SEARCH PATH FOR MANUAL PAGES

171       man  uses a sophisticated method of finding manual page files, based on
172       the invocation options and environment variables,  the  /etc/man.config
173       configuration file, and some built in conventions and heuristics.
174
175       First  of  all, when the name argument to man contains a slash (/), man
176       assumes it is a file specification itself, and there  is  no  searching
177       involved.
178
179       But in the normal case where name doesn't contain a slash, man searches
180       a variety of directories for a file that could be a manual page for the
181       topic named.
182
183       If  you  specify  the -M pathlist option, pathlist is a colon-separated
184       list of the directories that man searches.
185
186       If you don't specify -M but set the MANPATH environment  variable,  the
187       value  of  that  variable  is  the  list  of  the  directories that man
188       searches.
189
190       If you don't specify an explicit path list  with  -M  or  MANPATH,  man
191       develops  its  own path list based on the contents of the configuration
192       file /etc/man.config.  The MANPATH statements in the configuration file
193       identify particular directories to include in the search path.
194
195       Furthermore,  the MANPATH_MAP statements add to the search path depend‐
196       ing on your command search path (i.e. your PATH environment  variable).
197       For  each  directory  that  may  be  in the command search path, a MAN‐
198       PATH_MAP statement specifies a directory that should be  added  to  the
199       search  path for manual page files.  man looks at the PATH variable and
200       adds the corresponding directories to the manual page file search path.
201       Thus,  with  the  proper use of MANPATH_MAP, when you issue the command
202       man xyz, you get a manual page for the program that would  run  if  you
203       issued the command xyz.
204
205       In  addition, for each directory in the command search path (we'll call
206       it a "command directory") for which  you  do  not  have  a  MANPATH_MAP
207       statement, man automatically looks for a manual page directory "nearby"
208       namely as a subdirectory in the command directory itself or in the par‐
209       ent directory of the command directory.
210
211       You  can  disable  the automatic "nearby" searches by including a NOAU‐
212       TOPATH statement in /etc/man.config.
213
214       In each directory in the search path as described above,  man  searches
215       for  a file named topic.section, with an optional suffix on the section
216       number and possibly a compression suffix.  If it doesn't  find  such  a
217       file, it then looks in any subdirectories named manN or catN where N is
218       the manual section number.  If the file is in a catN subdirectory,  man
219       assumes  it is a formatted manual page file (cat page).  Otherwise, man
220       assumes it is unformatted.  In either case, if the filename has a known
221       compression suffix (like .gz), man assumes it is gzipped.
222
223       If  you  want to see where (or if) man would find the manual page for a
224       particular topic, use the --path (-w) option.
225
226

ENVIRONMENT

228       MANPATH
229              If MANPATH is set, man uses it as the path to search for  manual
230              page  files.   It overrides the configuration file and the auto‐
231              matic search path,  but  is  overridden  by  the  -M  invocation
232              option.  See SEARCH PATH FOR MANUAL PAGES.
233
234       MANPL  If  MANPL  is set, its value is used as the display page length.
235              Otherwise, the entire man page will occupy one (long) page.
236
237       MANROFFSEQ
238              If MANROFFSEQ is set, its value is used to determine the set  of
239              preprocessors  run  before  running nroff or troff.  By default,
240              pages are passed through the tbl preprocessor before nroff.
241
242       MANSECT
243              If MANSECT is set, its value is used to determine  which  manual
244              sections to search.
245
246       MANWIDTH
247              If  MANWIDTH  is  set,  its  value is used as the width manpages
248              should be displayed.  Otherwise the pages may be displayed  over
249              the whole width of your screen.
250
251       MANPAGER
252              If MANPAGER is set, its value is used as the name of the program
253              to use to display the man page.  If not, then PAGER is used.  If
254              that has no value either, /usr/bin/less -is is used.
255
256       BROWSER
257              The  name  of a browser to use for displaying HTML manual pages.
258              If it is not set, /usr/bin/less -is is used.
259
260       HTMLPAGER
261              The command to use for rendering HTML manual pages as text.   If
262              it is not set, /bin/cat is used.
263
264       LANG   If  LANG  is set, its value defines the name of the subdirectory
265              where man first looks for man pages. Thus, the command  `LANG=dk
266              man  1  foo'  will  cause  man  to  look for the foo man page in
267              .../dk/man1/foo.1, and if it cannot find such a  file,  then  in
268              .../man1/foo.1, where ... is a directory on the search path.
269
270       NLSPATH, LC_MESSAGES, LANG
271              The  environment variables NLSPATH and LC_MESSAGES (or LANG when
272              the latter does not exist) play a role in locating  the  message
273              catalog.   (But  the  English  messages are compiled in, and for
274              English no catalog is required.)  Note that programs like col(1)
275              called by man also use e.g. LC_CTYPE.
276
277       PATH   PATH helps determine the search path for manual page files.  See
278              SEARCH PATH FOR MANUAL PAGES.
279
280       SYSTEM SYSTEM is used to get the default alternate system name (for use
281              with the -m option).
282

BUGS

284       The -t option only works if a troff-like program is installed.
285       If  you  see  blinking  \255  or  <AD>  instead  of hyphens, put `LESS‐
286       CHARSET=latin1' in your environment.
287

TIPS

289       If you add the line
290
291        (global-set-key [(f1)] (lambda ()  (interactive)  (manual-entry  (cur‐
292       rent-word))))
293
294       to your .emacs file, then hitting F1 will give you the man page for the
295       library call at the current cursor position.
296
297       To get a plain text version of  a  man  page,  without  backspaces  and
298       underscores, try
299
300         # man foo | col -b > foo.mantxt
301

AUTHOR

303       John  W.  Eaton  was  the  original  author  of man.  Zeyd M. Ben-Halim
304       released man 1.2, and Andries Brouwer followed  up  with  versions  1.3
305       thru  1.5p.   Federico  Lucifredi  <flucifredi@acm.org>  is the current
306       maintainer.
307

SEE ALSO

309       apropos(1), whatis(1), less(1), groff(1), man.config(5).
310
311
312
313                              September 19, 2005                        man(1)
Impressum