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. It
43 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
60 command recognizes the type of markup and
61 processes the file accordingly.
63 .Ss "Location of Manual Pages"
65 The online Reference Manual page directories are conventionally located in
67 Each directory corresponds to a
68 section of the manual. Since these directories are optionally installed, they
69 might not reside on your host. You might have to mount
71 from a host on which they do reside.
74 command reformats a page whenever it is requested.
76 If the standard output is not a terminal, or if the
80 pipes its output through
84 pipes its output through a pager such as
86 to handle paging and underlining on the screen.
88 The following options are supported:
89 .Bl -tag -width indent
91 Shows all manual pages matching
95 search path. Manual pages are displayed in the order found.
97 Debugs. Displays what a section-specifier evaluates to, method used for
98 searching, and paths searched by
101 Attempts to locate manual pages related to any of the given
103 names. It strips the leading path name components from each
105 and then prints one-line summaries containing the resulting basename or names.
106 This option also uses the
110 This option is present for backwards compatibility and is documented
111 here for reference only. It performs no function.
112 .It Fl k Ar keyword ...
113 Prints out one-line summaries from the
115 database (table of contents) that contain any of the given
119 database is created using the
123 Lists all manual pages found matching
125 within the search path.
127 Specifies an alternate search path for manual pages. The
129 is a colon-separated list of directories that contain manual page directory
130 subtrees. For example, if
133 .Pa /usr/share/man:/usr/local/man ,
137 in the standard location, and then
146 option must appear first. Each directory in the
148 is assumed to contain subdirectories of the form
150 one for each section. This option overrides the
152 environment variable.
154 Reformats the manual page, checking for formatting errors, but does not
157 Specifies sections of the manual for
159 to search. The directories searched for
161 are limited to those specified by
164 can be a numerical digit, perhaps followed by one or more letters
165 to match the desired section of the manual, for example,
169 can be a word, for example,
175 can also be a letter. To specify multiple sections,
176 separate each section with a comma. This option overrides the
178 environment variable and the
182 below for an explanation of how
186 Arranges for the specified manual pages to be sent to the default
187 printer as PostScript.
188 .It Fl T Ar macro-package
189 This option is present for backwards compatibility and is documented
190 here for reference only. It performs no function.
197 The following operand is supported:
198 .Bl -tag -width indent
200 The name of a standard utility or a keyword.
207 .Ss "Manual Page Sections"
209 Entries in the reference manuals are organized into
212 name consists of a major section name, typically a single digit, optionally
213 followed by a subsection name, typically one or more letters. An unadorned
214 major section name, for example,
216 does not act as an abbreviation for
217 the subsections of that name, such as
222 That is, each subsection must be searched separately by
225 Each section contains descriptions apropos to a particular reference category,
226 with subsections refining these distinctions. See the
228 manual pages for an explanation of the classification used in this release.
232 Before searching for a given
235 constructs a list of candidate directories and sections.
238 in the directories specified by the
240 environment variable.
245 constructs its search path based upon the
247 environment variable, primarily by substituting
249 for the last component of the
251 element. Special provisions are added
252 to account for unique characteristics of directories such as
256 and others. If the file argument contains
261 portion of the argument is used in place of
263 elements to construct the search path.
265 Within the manual page directories,
267 confines its search to the
268 sections specified in the following order:
272 specified on the command line with the
284 file for each directory specified in the
288 If none of the above exist,
290 searches each directory in the manual
291 page path, and displays the first matching manual page found.
295 file has the following format:
297 .Dl Pf MANSECTS= Ar section Ns Oo , Ns Ar section Oc Ns ...
301 and blank lines are considered comments, and are
302 ignored. Each directory specified in
304 can contain a manual page
305 configuration file, specifying the default search order for that directory.
306 .Sh "Referring to Other Manual Pages"
307 If the first line of the manual page is a reference to another manual
308 page entry fitting the pattern:
310 .Dl \&.so man*/\fIsourcefile\fR
313 processes the indicated file in place of the current one. The
314 reference must be expressed as a path name relative to the root of the manual
315 page directory subtree.
317 When the second or any subsequent line starts with \fB\&.so\fR, \fBman\fR
318 ignores it; \fBtroff\fR(1) or \fBnroff\fR(1) processes the request in the usual
320 .Sh ENVIRONMENT VARIABLES
323 for descriptions of the following environment variables
324 that affect the execution of
332 .Bl -tag -width indent
334 A colon-separated list of directories; each directory can be followed by a
335 comma-separated list of sections. If set, its value overrides
336 \fB/usr/share/man\fR as the default directory search path, and the \fBman.cf\fR
337 file as the default section search path. The \fB-M\fR and \fB-s\fR flags, in
338 turn, override these values.)
340 A program to use for interactively delivering
341 output to the screen. If not set,
347 .Bl -tag -width indent
348 .It Pa /usr/share/man
349 Root of the standard manual page directory subtree
350 .It Pa /usr/share/man/man?/*
351 Unformatted manual entries
352 .It Pa /usr/share/man/whatis
353 Table of contents and keyword database
355 Default search order by section
361 .Ss Example 1: Creating a PostScript Version of a man page
363 The following example spools the
365 man page in PostScript to the default printer:
367 .Dl % man -t -s 2 pipe
371 can be used to obtain the PostScript content directly.
372 .Ss Example 2: Creating a Text Version of a man page
373 The following example creates the
375 man page in ASCII text:
377 .Dl % man pipe.2 | col -x -b > pipe.text
378 .Sh CODE SET INDEPENDENCE
380 .Sh INTERFACE STABILITY
404 The manual is supposed to be reproducible either on a phototypesetter or on an
405 ASCII terminal. However, on a terminal some information (indicated by
406 font changes, for instance) is lost.