2 .\" The Berkeley software License Agreement specifies the terms and conditions
3 .\" for redistribution.
6 .\" Copyright (c) 1980 Regents of the University of California.
7 .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
8 .\" Copyright 2014 Garrett D'Amore <garrett@damore.org>
9 .\" Copyright 2016 Nexenta Systems, Inc.
16 .Nd find and display reference manual pages
21 .Op Fl T Ar macro-package
42 command displays information from the reference manuals.
43 It displays complete manual pages that you select by
45 or one-line summaries selected either by
48 or by the name of an associated file
50 If no manual page is located,
52 prints an error message.
54 Reference Manual pages are marked up with either
61 command recognizes the type of markup and
62 processes the file accordingly.
64 .Ss "Location of Manual Pages"
66 The online Reference Manual page directories are conventionally located in
68 Each directory corresponds to a
69 section of the manual.
70 Since these directories are optionally installed, they might not reside on your
72 You might have to mount
74 from a host on which they do reside.
77 command reformats a page whenever it is requested.
79 If the standard output is not a terminal, or if the
83 pipes its output through
87 pipes its output through a pager such as
89 to handle paging and underlining on the screen.
91 The following options are supported:
92 .Bl -tag -width indent
94 Shows all manual pages matching
99 Manual pages are displayed in the order found.
102 Displays what a section-specifier evaluates to, method used for searching, and
106 Attempts to locate manual pages related to any of the given
109 It strips the leading path name components from each
111 and then prints one-line summaries containing the resulting basename or names.
112 This option also uses the
116 This option is present for backwards compatibility and is documented
117 here for reference only.
118 It performs no function.
119 .It Fl k Ar keyword ...
120 Prints out one-line summaries from the
122 database (table of contents) that contain any of the given
126 database is created using the
130 Lists all manual pages found matching
132 within the search path.
134 Specifies an alternate search path for manual pages.
137 is a colon-separated list of directories that contain manual page directory
142 .Pa /usr/share/man:/usr/local/man ,
146 in the standard location, and then
155 option must appear first.
156 Each directory in the
158 is assumed to contain subdirectories of the form
160 one for each section.
161 This option overrides the
163 environment variable.
165 Reformats the manual page, checking for formatting errors, but does not
168 Specifies sections of the manual for
171 The directories searched for
173 are limited to those specified by
176 can be a numerical digit, perhaps followed by one or more letters
177 to match the desired section of the manual, for example,
181 can be a word, for example,
187 can also be a letter.
188 To specify multiple sections, separate each section with a comma.
189 This option overrides the
191 environment variable and the
196 below for an explanation of how
200 Arranges for the specified manual pages to be sent to the default
201 printer as PostScript.
202 .It Fl T Ar macro-package
203 This option is present for backwards compatibility and is documented
204 here for reference only.
205 It performs no function.
212 The following operand is supported:
213 .Bl -tag -width indent
215 The name of a standard utility or a keyword.
222 .Ss "Manual Page Sections"
224 Entries in the reference manuals are organized into
227 name consists of a major section name, typically a single digit, optionally
228 followed by a subsection name, typically one or more letters.
229 An unadorned major section name, for example,
231 does not act as an abbreviation for
232 the subsections of that name, such as
237 That is, each subsection must be searched separately by
240 Each section contains descriptions apropos to a particular reference category,
241 with subsections refining these distinctions.
244 manual pages for an explanation of the classification used in this release.
248 Before searching for a given
251 constructs a list of candidate directories and sections.
254 in the directories specified by the
256 environment variable.
261 constructs its search path based upon the
263 environment variable, primarily by substituting
265 for the last component of the
268 Special provisions are added to account for unique characteristics of
274 If the file argument contains a
278 portion of the argument is used in place of
280 elements to construct the search path.
282 Within the manual page directories,
284 confines its search to the
285 sections specified in the following order:
289 specified on the command line with the
301 file for each directory specified in the
305 If none of the above exist,
307 searches each directory in the manual
308 page path, and displays the first matching manual page found.
312 file has the following format:
314 .Dl Pf MANSECTS= Ar section Ns Oo , Ns Ar section Oc Ns ...
318 and blank lines are considered comments, and are
320 Each directory specified in
322 can contain a manual page
323 configuration file, specifying the default search order for that directory.
324 .Sh "Referring to Other Manual Pages"
325 If the first line of the manual page is a reference to another manual
326 page entry fitting the pattern:
328 .Dl \&.so man*/ Ns Em sourcefile
331 processes the indicated file in place of the current one.
332 The reference must be expressed as a path name relative to the root of the
333 manual page directory subtree.
335 When the second or any subsequent line starts with
342 processes the request in the usual manner.
343 .Sh ENVIRONMENT VARIABLES
346 for descriptions of the following environment variables
347 that affect the execution of
355 .Bl -tag -width MANWIDTH
357 A colon-separated list of directories; each directory can be followed by a
358 comma-separated list of sections.
359 If set, its value overrides
361 as the default directory search path, and the
363 file as the default section search path.
368 flags, in turn, override these values.
371 If set to the special value
376 and output is to terminal, auto-detect terminal width.
378 A program to use for interactively delivering
379 output to the screen.
387 .Bl -tag -width indent
388 .It Pa /usr/share/man
389 Root of the standard manual page directory subtree
390 .It Pa /usr/share/man/man?/*
391 Unformatted manual entries
392 .It Pa /usr/share/man/whatis
393 Table of contents and keyword database
395 Default search order by section
401 .Ss Example 1: Creating a PostScript Version of a man page
403 The following example spools the
405 man page in PostScript to the default printer:
407 .Dl % man -t -s 2 pipe
411 can be used to obtain the PostScript content directly.
412 .Ss Example 2: Creating a Text Version of a man page
413 The following example creates the
415 man page in ASCII text:
417 .Dl % man pipe.2 | col -x -b > pipe.text
418 .Sh CODE SET INDEPENDENCE
420 .Sh INTERFACE STABILITY
444 The manual is supposed to be reproducible either on a phototypesetter or on an
446 However, on a terminal some information (indicated by font changes, for