Experimenting with making pretty man pages on paper.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1280 lines
32 KiB

  1. '\" t
  2. .\" ** The above line should force tbl to be a preprocessor **
  3. .\" Man page for man
  4. .\"
  5. .\" Copyright (C) 1994, 1995, Graeme W. Wilford. (Wilf.)
  6. .\" Copyright (C) 2001-2019 Colin Watson.
  7. .\"
  8. .\" You may distribute under the terms of the GNU General Public
  9. .\" License as specified in the file COPYING that comes with the
  10. .\" man-db distribution.
  11. .\"
  12. .\" Sat Oct 29 13:09:31 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
  13. .\"
  14. .pc
  15. .TH MAN 1 "2020-02-25" "2.9.1" "Manual pager utils"
  16. .SH NAME
  17. man \- an interface to the system reference manuals
  18. .SH SYNOPSIS
  19. .\" The general command line
  20. .B man
  21. .RI [\| "man options" \|]
  22. .RI [\|[\| section \|]
  23. .IR page \ \|.\|.\|.\|]\ \.\|.\|.\&
  24. .\" The apropos command line
  25. .br
  26. .B man
  27. .B \-k
  28. .RI [\| "apropos options" \|]
  29. .I regexp
  30. \&.\|.\|.\&
  31. .\" The --global-apropos command line
  32. .br
  33. .B man
  34. .B \-K
  35. .RI [\| "man options" \|]
  36. .RI [\| section \|]
  37. .IR term \ .\|.\|.\&
  38. .\" The whatis command line
  39. .br
  40. .B man
  41. .B \-f
  42. .RI [\| whatis
  43. .IR options \|]
  44. .I page
  45. \&.\|.\|.\&
  46. .\" The --local command line
  47. .br
  48. .B man
  49. .B \-l
  50. .RI [\| "man options" \|]
  51. .I file
  52. \&.\|.\|.\&
  53. .\" The --where/--where-cat command line
  54. .br
  55. .B man
  56. .BR \-w \||\| \-W
  57. .RI [\| "man options" \|]
  58. .I page
  59. \&.\|.\|.\&
  60. .SH DESCRIPTION
  61. .B man
  62. is the system's manual pager.
  63. Each
  64. .I page
  65. argument given to
  66. .B man
  67. is normally the name of a program, utility or function.
  68. The
  69. .I manual page
  70. associated with each of these arguments is then found and displayed.
  71. A
  72. .IR section ,
  73. if provided, will direct
  74. .B man
  75. to look only in that
  76. .I section
  77. of the manual.
  78. The default action is to search in all of the available
  79. .IR sections
  80. following a pre-defined order (see
  81. .BR DEFAULTS ),
  82. and to show only the first
  83. .I page
  84. found, even if
  85. .I page
  86. exists in several
  87. .IR sections .
  88. The table below shows the
  89. .I section
  90. numbers of the manual followed by the types of pages they contain.
  91. .TS
  92. tab (@);
  93. l lx.
  94. 1@T{
  95. Executable programs or shell commands
  96. T}
  97. 2@T{
  98. System calls (functions provided by the kernel)
  99. T}
  100. 3@T{
  101. Library calls (functions within program libraries)
  102. T}
  103. 4@T{
  104. Special files (usually found in \fI/dev\/\fR)
  105. T}
  106. 5@T{
  107. File formats and conventions, e.g.\& \fI/etc/passwd\fR
  108. T}
  109. 6@T{
  110. Games
  111. T}
  112. 7@T{
  113. Miscellaneous (including macro packages and conventions),
  114. e.g.\& \fBman\fR(7), \fBgroff\fR(7)
  115. T}
  116. 8@T{
  117. System administration commands (usually only for root)
  118. T}
  119. 9@T{
  120. Kernel routines [\|Non standard\|]
  121. T}
  122. .TE
  123. A manual
  124. .I page
  125. consists of several sections.
  126. Conventional section names include
  127. .BR NAME ,
  128. .BR SYNOPSIS ,
  129. .BR CONFIGURATION ,
  130. .BR DESCRIPTION ,
  131. .BR OPTIONS ,
  132. .BR EXIT\ STATUS ,
  133. .BR RETURN\ VALUE ,
  134. .BR ERRORS ,
  135. .BR ENVIRONMENT ,
  136. .BR FILES ,
  137. .BR VERSIONS ,
  138. .BR CONFORMING\ TO ,
  139. .BR NOTES ,
  140. .BR BUGS ,
  141. .BR EXAMPLE ,
  142. .BR AUTHORS ,
  143. and
  144. .BR SEE\ ALSO .
  145. The following conventions apply to the
  146. .B SYNOPSIS
  147. section and can be used as a guide in other sections.
  148. .TS
  149. tab (@);
  150. l lx.
  151. \fBbold text\fR@T{
  152. type exactly as shown.
  153. T}
  154. \fIitalic text\fR@T{
  155. replace with appropriate argument.
  156. T}
  157. [\|\fB\-abc\fR\|]@T{
  158. any or all arguments within [ ] are optional.
  159. T}
  160. \fB\-a\|\fR|\|\fB\-b\fR@T{
  161. options delimited by | cannot be used together.
  162. T}
  163. \fIargument\fR .\|.\|.@T{
  164. \fIargument\fR is repeatable.
  165. T}
  166. [\|\fIexpression\fR\|]\fR .\|.\|.@T{
  167. \fRentire \fIexpression\fR\ within [ ] is repeatable.
  168. T}
  169. .TE
  170. Exact rendering may vary depending on the output device.
  171. For instance, man will usually not be able to render italics when running in
  172. a terminal, and will typically use underlined or coloured text instead.
  173. The command or function illustration is a pattern that should match all
  174. possible invocations.
  175. In some cases it is advisable to illustrate several exclusive invocations
  176. as is shown in the
  177. .B SYNOPSIS
  178. section of this manual page.
  179. .SH EXAMPLES
  180. .TP \w'man\ 'u
  181. .BI man \ ls
  182. Display the manual page for the
  183. .I item
  184. (program)
  185. .IR ls .
  186. .TP
  187. \fBman\fR \fIman\fR.\fI7\fR
  188. Display the manual page for macro package
  189. .I man
  190. from section
  191. .IR 7 .
  192. (This is an alternative spelling of
  193. "\fBman\fR \fI7 man\fR".)
  194. .TP
  195. \fBman '\fIman\fR(\fI7\fR)'
  196. Display the manual page for macro package
  197. .I man
  198. from section
  199. .IR 7 .
  200. (This is another alternative spelling of
  201. "\fBman\fR \fI7 man\fR".
  202. It may be more convenient when copying and pasting cross-references to
  203. manual pages.
  204. Note that the parentheses must normally be quoted to protect them from the
  205. shell.)
  206. .TP
  207. .BI man\ \-a \ intro
  208. Display, in succession, all of the available
  209. .I intro
  210. manual pages contained within the manual.
  211. It is possible to quit between successive displays or skip any of them.
  212. .TP
  213. \fBman \-t \fIbash \fR|\fI lpr \-Pps
  214. Format the manual page for
  215. .I bash
  216. into the default
  217. .B troff
  218. or
  219. .B groff
  220. format and pipe it to the printer named
  221. .IR ps .
  222. The default output for
  223. .B groff
  224. is usually PostScript.
  225. .B man \-\-help
  226. should advise as to which processor is bound to the
  227. .B \-t
  228. option.
  229. .TP
  230. .BI "man \-l \-T" "dvi ./foo.1x.gz" " > " ./foo.1x.dvi
  231. This command will decompress and format the nroff source manual page
  232. .I ./foo.1x.gz
  233. into a
  234. .B device independent (dvi)
  235. file.
  236. The redirection is necessary as the
  237. .B \-T
  238. flag causes output to be directed to
  239. .B stdout
  240. with no pager.
  241. The output could be viewed with a program such as
  242. .B xdvi
  243. or further processed into PostScript using a program such as
  244. .BR dvips .
  245. .TP
  246. .BI man\ \-k \ printf
  247. Search the short descriptions and manual page names for the keyword
  248. .I printf
  249. as regular expression.
  250. Print out any matches.
  251. Equivalent to
  252. .BI apropos \ printf .
  253. .TP
  254. .BI man\ \-f \ smail
  255. Lookup the manual pages referenced by
  256. .I smail
  257. and print out the short descriptions of any found.
  258. Equivalent to
  259. .BI whatis \ smail .
  260. .SH OVERVIEW
  261. Many options are available to
  262. .B man
  263. in order to give as much flexibility as possible to the user.
  264. Changes can be made to the search path, section order, output processor,
  265. and other behaviours and operations detailed below.
  266. If set, various environment variables are interrogated to determine
  267. the operation of
  268. .BR man .
  269. It is possible to set the "catch-all" variable
  270. .RB $ MANOPT
  271. to any string in command line format, with the exception that any spaces
  272. used as part of an option's argument must be escaped (preceded by a
  273. backslash).
  274. .B man
  275. will parse
  276. .RB $ MANOPT
  277. prior to parsing its own command line.
  278. Those options requiring an argument will be overridden by the same options
  279. found on the command line.
  280. To reset all of the options set in
  281. .RB $ MANOPT ,
  282. .B \-D
  283. can be specified as the initial command line option.
  284. This will allow man to "forget" about the options specified in
  285. .RB $ MANOPT ,
  286. although they must still have been valid.
  287. Manual pages are normally stored in
  288. .BR nroff (1)
  289. format under a directory such as
  290. .IR /usr/share/man .
  291. In some installations, there may also be preformatted
  292. .I cat pages
  293. to improve performance.
  294. See
  295. .BR manpath (5)
  296. for details of where these files are stored.
  297. This package supports manual pages in multiple languages, controlled by your
  298. .IR locale .
  299. If your system did not set this up for you automatically, then you may need
  300. to set
  301. .RB $ LC_MESSAGES ,
  302. .RB $ LANG ,
  303. or another system-dependent environment variable to indicate your preferred
  304. locale, usually specified in the
  305. .B POSIX
  306. format:
  307. .\"
  308. .\" Need a \c to make sure we don't get a space where we don't want one
  309. .\"
  310. .RI < language >[\|\c
  311. .B _\c
  312. .RI < territory >\|[\|\c
  313. .B .\c
  314. .RI < character-set >\|[\|\c
  315. .B ,\c
  316. .RI < version >\|]\|]\|]
  317. If the desired page is available in your
  318. .IR locale ,
  319. it will be displayed in lieu of the standard
  320. (usually American English) page.
  321. If you find that the translations supplied with this package are not
  322. available in your native language and you would like to supply them, please
  323. contact the maintainer who will be coordinating such activity.
  324. Individual manual pages are normally written and maintained by the
  325. maintainers of the program, function, or other topic that they document, and
  326. are not included with this package.
  327. If you find that a manual page is missing or inadequate, please report that
  328. to the maintainers of the package in question.
  329. For information regarding other features and extensions available with this
  330. manual pager, please read the documents supplied with the package.
  331. .SH DEFAULTS
  332. The order of sections to search may be overridden by the environment
  333. variable
  334. .RB $ MANSECT
  335. or by the
  336. .B SECTION
  337. directive in
  338. .IR /etc/manpath.config .
  339. By default it is as follows:
  340. .RS
  341. 1 n l 8 3 2 3posix 3pm 3perl 3am 5 4 9 6 7
  342. .RE
  343. The formatted manual page is displayed using a
  344. .IR pager .
  345. This can be specified in a number of ways, or else will fall back to a
  346. default (see option
  347. .B \-P
  348. for details).
  349. The filters are deciphered by a number of means.
  350. Firstly, the command line option
  351. .B \-p
  352. or the environment variable
  353. .RB $ MANROFFSEQ
  354. is interrogated.
  355. If
  356. .B \-p
  357. was not used and the environment variable was not set, the initial line of
  358. the nroff file is parsed for a preprocessor string.
  359. To contain a valid preprocessor string, the first line must resemble
  360. .B '\e"
  361. .RB < string >
  362. where
  363. .B string
  364. can be any combination of letters described by option
  365. .B \-p
  366. below.
  367. If none of the above methods provide any filter information, a default set
  368. is used.
  369. A formatting pipeline is formed from the filters and the primary
  370. formatter
  371. .RB ( nroff
  372. or
  373. .RB [ tg ] roff
  374. with
  375. .BR \-t )
  376. and executed.
  377. Alternatively, if an executable program
  378. .I mandb_nfmt
  379. (or
  380. .I mandb_tfmt
  381. with
  382. .BR \-t )
  383. exists in the man tree root, it is executed instead.
  384. It gets passed the manual source file, the preprocessor string, and
  385. optionally the device specified with
  386. .BR \-T " or " \-E
  387. as arguments.
  388. .\" ********************************************************************
  389. .SH OPTIONS
  390. Non-argument options that are duplicated either on the command line, in
  391. .RB $ MANOPT ,
  392. or both, are not harmful.
  393. For options that require an argument, each duplication will override the
  394. previous argument value.
  395. .SS "General options"
  396. .TP
  397. .BI \-C\ file \fR,\ \fB\-\-config\-file= file
  398. Use this user configuration file rather than the default of
  399. .IR ~/.manpath .
  400. .TP
  401. .BR \-d ", " \-\-debug
  402. Print debugging information.
  403. .TP
  404. .BR \-D ", " \-\-default
  405. This option is normally issued as the very first option and resets
  406. .B man's
  407. behaviour to its default.
  408. Its use is to reset those options that may have been set in
  409. .RB $ MANOPT .
  410. Any options that follow
  411. .B \-D
  412. will have their usual effect.
  413. .TP
  414. \fB\-\-warnings\fP[=\fIwarnings\/\fP]
  415. Enable warnings from
  416. .IR groff .
  417. This may be used to perform sanity checks on the source text of manual
  418. pages.
  419. .I warnings
  420. is a comma-separated list of warning names; if it is not supplied, the
  421. default is "mac".
  422. See the \(lqWarnings\(rq node in
  423. .B info groff
  424. for a list of available warning names.
  425. .SS "Main modes of operation"
  426. .TP
  427. .BR \-f ", " \-\-whatis
  428. Equivalent to
  429. .BR whatis .
  430. Display a short description from the manual page, if available.
  431. See
  432. .BR whatis (1)
  433. for details.
  434. .TP
  435. .BR \-k ", " \-\-apropos
  436. Equivalent to
  437. .BR apropos .
  438. Search the short manual page descriptions for keywords and display any
  439. matches.
  440. See
  441. .BR apropos (1)
  442. for details.
  443. .TP
  444. .BR \-K ", " \-\-global\-apropos
  445. Search for text in all manual pages.
  446. This is a brute-force search, and is likely to take some time; if you can,
  447. you should specify a section to reduce the number of pages that need to be
  448. searched.
  449. Search terms may be simple strings (the default), or regular expressions if
  450. the
  451. .B \-\-regex
  452. option is used.
  453. .IP
  454. Note that this searches the
  455. .I sources
  456. of the manual pages, not the rendered text, and so may include false
  457. positives due to things like comments in source files.
  458. Searching the rendered text would be much slower.
  459. .TP
  460. .BR \-l ", " \-\-local\-file
  461. Activate "local" mode.
  462. Format and display local manual files instead of searching through the
  463. system's manual collection.
  464. Each manual page argument will be interpreted as an nroff source file in the
  465. correct format.
  466. .\" Compressed nroff source files with a supported compression
  467. .\" extension will be decompressed by man prior to being displaying via the
  468. .\" usual filters.
  469. No cat file is produced.
  470. If '\-' is listed as one of the arguments, input will be taken from stdin.
  471. When this option is not used, and man fails to find the page required,
  472. before displaying the error message, it attempts to act as if this
  473. option was supplied, using the name as a filename and looking for an
  474. exact match.
  475. .TP
  476. .BR \-w ", " \-\-where ", " \-\-path ", " \-\-location
  477. Don't actually display the manual page, but do print the location of the
  478. source nroff file that would be formatted.
  479. If the
  480. .B \-a
  481. option is also used, then print the locations of all source files that match
  482. the search criteria.
  483. .TP
  484. .BR \-W ", " \-\-where\-cat ", " \-\-location\-cat
  485. Don't actually display the manual page, but do print the location of the
  486. preformatted cat file that would be displayed.
  487. If the
  488. .B \-a
  489. option is also used, then print the locations of all preformatted cat files
  490. that match the search criteria.
  491. .IP
  492. If
  493. .B \-w
  494. and
  495. .B \-W
  496. are both used, then print both source file and cat file separated by a
  497. space.
  498. If
  499. all of
  500. .BR \-w ,
  501. .BR \-W ,
  502. and
  503. .B \-a
  504. are used, then do this for each possible match.
  505. .TP
  506. .BR \-c ", " \-\-catman
  507. This option is not for general use and should only be used by the
  508. .B catman
  509. program.
  510. .TP
  511. .BI \-R\ encoding\fR,\ \fI \-\-recode\fR=\fIencoding
  512. Instead of formatting the manual page in the usual way, output its source
  513. converted to the specified
  514. .IR encoding .
  515. If you already know the encoding of the source file, you can also use
  516. .BR manconv (1)
  517. directly.
  518. However, this option allows you to convert several manual pages to a single
  519. encoding without having to explicitly state the encoding of each, provided
  520. that they were already installed in a structure similar to a manual page
  521. hierarchy.
  522. .IP
  523. Consider using
  524. .BR man-recode (1)
  525. instead for converting multiple manual pages, since it has an interface
  526. designed for bulk conversion and so can be much faster.
  527. .SS "Finding manual pages"
  528. .TP
  529. .BI \-L\ locale \fR,\ \fB\-\-locale= locale
  530. .B man
  531. will normally determine your current locale by a call to the C function
  532. .BR setlocale (3)
  533. which interrogates various environment variables, possibly including
  534. .RB $ LC_MESSAGES
  535. and
  536. .RB $ LANG .
  537. To temporarily override the determined value, use this option to supply a
  538. .I locale
  539. string directly to
  540. .BR man .
  541. Note that it will not take effect until the search for pages actually
  542. begins.
  543. Output such as the help message will always be displayed in the initially
  544. determined locale.
  545. .TP
  546. \fB\-m\fR \fIsystem\fR\|[\|,.\|.\|.\|]\|, \
  547. \fB\-\-systems=\fIsystem\fR\|[\|,.\|.\|.\|]
  548. If this system has access to other operating system's manual pages, they can
  549. be accessed using this option.
  550. To search for a manual page from NewOS's manual page collection,
  551. use the option
  552. .B \-m
  553. .BR NewOS .
  554. The
  555. .I system
  556. specified can be a combination of comma delimited operating system names.
  557. To include a search of the native operating system's manual pages,
  558. include the system name
  559. .B man
  560. in the argument string.
  561. This option will override the
  562. .RB $ SYSTEM
  563. environment variable.
  564. .TP
  565. .BI \-M\ path \fR,\ \fB\-\-manpath= path
  566. Specify an alternate manpath to use.
  567. By default,
  568. .B man
  569. uses
  570. .B manpath
  571. derived code to determine the path to search.
  572. This option overrides the
  573. .RB $ MANPATH
  574. environment variable and causes option
  575. .B \-m
  576. to be ignored.
  577. A path specified as a manpath must be the root of a manual page hierarchy
  578. structured into sections as described in the man-db manual (under "The
  579. manual page system").
  580. To view manual pages outside such hierarchies, see the
  581. .B \-l
  582. option.
  583. .TP
  584. \fB\-S\fR \fIlist\/\fR, \
  585. \fB\-s\fR \fIlist\/\fR, \
  586. \fB\-\-sections=\fIlist\/\fR
  587. The given
  588. .I list
  589. is a colon- or comma-separated list of sections, used to determine which
  590. manual sections to search and in what order.
  591. This option overrides the
  592. .RB $ MANSECT
  593. environment variable.
  594. (The
  595. .B \-s
  596. spelling is for compatibility with System V.)
  597. .TP
  598. .BI \-e\ sub-extension \fR,\ \fB\-\-extension= sub-extension
  599. Some systems incorporate large packages of manual pages, such as those that
  600. accompany the
  601. .B Tcl
  602. package, into the main manual page hierarchy.
  603. To get around the problem of having two manual pages with the same name
  604. such as
  605. .BR exit (3),
  606. the
  607. .B Tcl
  608. pages were usually all assigned to section
  609. .BR l .
  610. As this is unfortunate, it is now possible to put the pages in the correct
  611. section, and to assign a specific "extension" to them, in this case,
  612. .BR exit (3tcl).
  613. Under normal operation,
  614. .B man
  615. will display
  616. .BR exit (3)
  617. in preference to
  618. .BR exit (3tcl).
  619. To negotiate this situation and to avoid having to know which section the
  620. page you require resides in, it is now possible to give
  621. .B man
  622. a
  623. .I sub-extension
  624. string indicating which package the page must belong to.
  625. Using the above example, supplying the option
  626. .B \-e\ tcl
  627. to
  628. .B man
  629. will restrict the search to pages having an extension of
  630. .BR *tcl .
  631. .TP
  632. .BR \-i ", " \-\-ignore\-case
  633. Ignore case when searching for manual pages.
  634. This is the default.
  635. .TP
  636. .BR \-I ", " \-\-match\-case
  637. Search for manual pages case-sensitively.
  638. .TP
  639. .B \-\-regex
  640. Show all pages with any part of either their names or their descriptions
  641. matching each
  642. .I page
  643. argument as a regular expression, as with
  644. .BR apropos (1).
  645. Since there is usually no reasonable way to pick a "best" page when
  646. searching for a regular expression, this option implies
  647. .BR \-a .
  648. .TP
  649. .B \-\-wildcard
  650. Show all pages with any part of either their names or their descriptions
  651. matching each
  652. .I page
  653. argument using shell-style wildcards, as with
  654. .BR apropos (1)
  655. .BR \-\-wildcard .
  656. The
  657. .I page
  658. argument must match the entire name or description, or match on word
  659. boundaries in the description.
  660. Since there is usually no reasonable way to pick a "best" page when
  661. searching for a wildcard, this option implies
  662. .BR \-a .
  663. .TP
  664. .B \-\-names\-only
  665. If the
  666. .B \-\-regex
  667. or
  668. .B \-\-wildcard
  669. option is used, match only page names, not page descriptions, as with
  670. .BR whatis (1).
  671. Otherwise, no effect.
  672. .TP
  673. .BR \-a ", " \-\-all
  674. By default,
  675. .B man
  676. will exit after displaying the most suitable manual page it finds.
  677. Using this option forces
  678. .B man
  679. to display all the manual pages with names that match the search criteria.
  680. .TP
  681. .BR \-u ", " \-\-update
  682. This option causes
  683. .B man
  684. to update its database caches of installed manual pages.
  685. This is only needed in rare situations, and it is normally better to run
  686. .BR mandb (8)
  687. instead.
  688. .TP
  689. .B \-\-no\-subpages
  690. By default,
  691. .B man
  692. will try to interpret pairs of manual page names given on the command line
  693. as equivalent to a single manual page name containing a hyphen or an
  694. underscore.
  695. This supports the common pattern of programs that implement a number of
  696. subcommands, allowing them to provide manual pages for each that can be
  697. accessed using similar syntax as would be used to invoke the subcommands
  698. themselves.
  699. For example:
  700. .nf
  701. \& $ man \-aw git diff
  702. \& /usr/share/man/man1/git\-diff.1.gz
  703. .fi
  704. To disable this behaviour, use the
  705. .B \-\-no\-subpages
  706. option.
  707. .nf
  708. \& $ man \-aw \-\-no\-subpages git diff
  709. \& /usr/share/man/man1/git.1.gz
  710. \& /usr/share/man/man3/Git.3pm.gz
  711. \& /usr/share/man/man1/diff.1.gz
  712. .fi
  713. .SS "Controlling formatted output"
  714. .TP
  715. .BI \-P\ pager \fR,\ \fB\-\-pager= pager
  716. Specify which output pager to use.
  717. By default,
  718. .B man
  719. uses
  720. .BR "pager" ,
  721. falling back to
  722. .B cat
  723. if
  724. .B pager
  725. is not found or is not executable.
  726. This option overrides the
  727. .RB $ MANPAGER
  728. environment variable, which in turn overrides the
  729. .RB $ PAGER
  730. environment variable.
  731. It is not used in conjunction with
  732. .B \-f
  733. or
  734. .BR \-k .
  735. The value may be a simple command name or a command with arguments, and may
  736. use shell quoting (backslashes, single quotes, or double quotes).
  737. It may not use pipes to connect multiple commands; if you need that, use a
  738. wrapper script, which may take the file to display either as an argument or
  739. on standard input.
  740. .TP
  741. .BI \-r\ prompt \fR,\ \fB\-\-prompt= prompt
  742. If a recent version of
  743. .B less
  744. is used as the pager,
  745. .B man
  746. will attempt to set its prompt and some sensible options.
  747. The default prompt looks like
  748. .B \ Manual page\c
  749. .IB \ name ( sec )\c
  750. .BI \ line \ x
  751. where
  752. .I name
  753. denotes the manual page name,
  754. .I sec
  755. denotes the section it was found under and
  756. .I x
  757. the current line number.
  758. .\"The default options are
  759. .\".BR \-six8 .
  760. This is achieved by using the
  761. .RB $ LESS
  762. environment variable.
  763. .\"The actual default will depend on your chosen
  764. .\".BR locale .
  765. Supplying
  766. .B \-r
  767. with a string will override this default.
  768. .\"You may need to do this if your
  769. .\"version of
  770. .\".B less
  771. .\"rejects the default options or if you prefer a different prompt.
  772. The string may contain the text
  773. .B $MAN_PN
  774. which will be expanded to the name of the current manual page and its
  775. section name surrounded by "(" and ")".
  776. The string used to produce the default could be expressed as
  777. .B \e\ Manual\e\ page\e\ \e$MAN_PN\e\ ?ltline\e\ %lt?L/%L.:
  778. .br
  779. .B byte\e\ %bB?s/%s..?\e\ (END):?pB\e\ %pB\e\e%..
  780. .br
  781. .B (press h for help or q to quit)
  782. It is broken into three lines here for the sake of readability only.
  783. For its meaning see the
  784. .BR less (1)
  785. manual page.
  786. The prompt string is first evaluated by the shell.
  787. All double quotes, back-quotes and backslashes in the prompt must be escaped
  788. by a preceding backslash.
  789. The prompt string may end in an escaped $ which may be followed by further
  790. options for less.
  791. By default
  792. .B man
  793. sets the
  794. .B \-ix8
  795. options.
  796. The
  797. .RB $ MANLESS
  798. environment variable described below may be used to set a default prompt
  799. string if none is supplied on the command line.
  800. .TP
  801. .BR \-7 ", " \-\-ascii
  802. When viewing a pure
  803. .IR ascii (7)
  804. manual page on a 7 bit terminal or terminal emulator, some characters may
  805. not display correctly when using the
  806. .IR latin1 (7)
  807. device description with
  808. .B GNU
  809. .BR nroff .
  810. This option allows pure
  811. .I ascii
  812. manual pages to be displayed in
  813. .I ascii
  814. with the
  815. .I latin1
  816. device.
  817. It will not translate any
  818. .I latin1
  819. text.
  820. The following table shows the translations performed: some parts of it may
  821. only be displayed properly when using
  822. .B GNU
  823. .BR nroff 's
  824. .IR latin1 (7)
  825. device.
  826. .ie c \[shc] \
  827. . ds softhyphen \[shc]
  828. .el \
  829. . ds softhyphen \(hy
  830. .na
  831. .TS
  832. tab (@);
  833. l c c c.
  834. Description@Octal@latin1@ascii
  835. _
  836. T{
  837. continuation hyphen
  838. T}@255@\*[softhyphen]@-
  839. T{
  840. bullet (middle dot)
  841. T}@267@\(bu@o
  842. T{
  843. acute accent
  844. T}@264@\(aa@'
  845. T{
  846. multiplication sign
  847. T}@327@\(mu@x
  848. .TE
  849. .ad
  850. If the
  851. .I latin1
  852. column displays correctly, your terminal may be set up for
  853. .I latin1
  854. characters and this option is not necessary.
  855. If the
  856. .I latin1
  857. and
  858. .I ascii
  859. columns are identical, you are reading this page using this option or
  860. .B man
  861. did not format this page using the
  862. .I latin1
  863. device description.
  864. If the
  865. .I latin1
  866. column is missing or corrupt, you may need to view manual pages with this
  867. option.
  868. This option is ignored when using options
  869. .BR \-t ,
  870. .BR \-H ,
  871. .BR \-T ,
  872. or
  873. .B \-Z
  874. and may be useless for
  875. .B nroff
  876. other than
  877. .BR GNU's .
  878. .TP
  879. .BI \-E\ encoding\fR,\ \fI \-\-encoding\fR=\fIencoding
  880. Generate output for a character encoding other than the default.
  881. For backward compatibility,
  882. .I encoding
  883. may be an
  884. .B nroff
  885. device such as
  886. .BR ascii ", " latin1 ", or " utf8
  887. as well as a true character encoding such as
  888. .BR UTF\-8 .
  889. .TP
  890. .BR \-\-no\-hyphenation ", " \-\-nh
  891. Normally,
  892. .B nroff
  893. will automatically hyphenate text at line breaks even in words that do not
  894. contain hyphens, if it is necessary to do so to lay out words on a line
  895. without excessive spacing.
  896. This option disables automatic hyphenation, so words will only be hyphenated
  897. if they already contain hyphens.
  898. If you are writing a manual page and simply want to prevent
  899. .B nroff
  900. from hyphenating a word at an inappropriate point, do not use this option,
  901. but consult the
  902. .B nroff
  903. documentation instead; for instance, you can put "\e%" inside a word to
  904. indicate that it may be hyphenated at that point, or put "\e%" at the start
  905. of a word to prevent it from being hyphenated.
  906. .TP
  907. .BR \-\-no\-justification ", " \-\-nj
  908. Normally,
  909. .B nroff
  910. will automatically justify text to both margins.
  911. This option disables full justification, leaving justified only to the left
  912. margin, sometimes called "ragged-right" text.
  913. If you are writing a manual page and simply want to prevent
  914. .B nroff
  915. from justifying certain paragraphs, do not use this option, but consult the
  916. .B nroff
  917. documentation instead; for instance, you can use the ".na", ".nf", ".fi",
  918. and ".ad" requests to temporarily disable adjusting and filling.
  919. .TP
  920. .BI \-p\ string \fR,\ \fB\-\-preprocessor= string
  921. Specify the sequence of preprocessors to run before
  922. .B nroff
  923. or
  924. .BR troff / groff .
  925. Not all installations will have a full set of preprocessors.
  926. Some of the preprocessors and the letters used to designate them are:
  927. .BR eqn " (" e ),
  928. .BR grap " (" g ),
  929. .BR pic " (" p ),
  930. .BR tbl " (" t ),
  931. .BR vgrind " (" v ),
  932. .BR refer " (" r ).
  933. This option overrides the
  934. .RB $ MANROFFSEQ
  935. environment variable.
  936. .B zsoelim
  937. is always run as the very first preprocessor.
  938. .TP
  939. .BR \-t ", " \-\-troff
  940. Use
  941. .I groff \-mandoc
  942. to format the manual page to stdout.
  943. This option is not required in conjunction with
  944. .BR \-H ,
  945. .BR \-T ,
  946. or
  947. .BR \-Z .
  948. .TP
  949. \fB\-T\fP[\fIdevice\/\fP], \fB\-\-troff\-device\fP[=\fIdevice\/\fP]
  950. This option is used to change
  951. .B groff
  952. (or possibly
  953. .BR troff's )
  954. output to be suitable for a device other than the default.
  955. It implies
  956. .BR \-t .
  957. Examples (provided with Groff-1.17) include
  958. .BR dvi ", " latin1 ", " ps ", " utf8 ,
  959. .BR X75 " and " X100 .
  960. .TP
  961. \fB\-H\fP[\fIbrowser\/\fP], \fB\-\-html\fP[=\fIbrowser\/\fP]
  962. This option will cause
  963. .B groff
  964. to produce HTML output, and will display that output in a web browser.
  965. The choice of browser is determined by the optional
  966. .I browser
  967. argument if one is provided, by the
  968. .RB $ BROWSER
  969. environment variable, or by a compile-time default if that is unset (usually
  970. .BR lynx ).
  971. This option implies
  972. .BR \-t ,
  973. and will only work with
  974. .B GNU
  975. .BR troff .
  976. .TP
  977. \fB\-X\fP[\fIdpi\/\fP], \fB\-\-gxditview\fP[=\fIdpi\/\fP]
  978. This option displays the output of
  979. .B groff
  980. in a graphical window using the
  981. .B gxditview
  982. program.
  983. The
  984. .I dpi
  985. (dots per inch) may be 75, 75-12, 100, or 100-12, defaulting to 75;
  986. the -12 variants use a 12-point base font.
  987. This option implies
  988. .B \-T
  989. with the X75, X75-12, X100, or X100-12 device respectively.
  990. .TP
  991. .BR \-Z ", " \-\-ditroff
  992. .B groff
  993. will run
  994. .B troff
  995. and then use an appropriate post-processor to produce output suitable for
  996. the chosen device.
  997. If
  998. .I groff \-mandoc
  999. is
  1000. .BR groff ,
  1001. this option is passed to
  1002. .B groff
  1003. and will suppress the use of a post-processor.
  1004. It implies
  1005. .BR \-t .
  1006. .SS "Getting help"
  1007. .TP
  1008. .BR \-? ", " \-\-help
  1009. Print a help message and exit.
  1010. .TP
  1011. .B \-\-usage
  1012. Print a short usage message and exit.
  1013. .TP
  1014. .BR \-V ", " \-\-version
  1015. Display version information.
  1016. .SH "EXIT STATUS"
  1017. .TP
  1018. .B 0
  1019. Successful program execution.
  1020. .TP
  1021. .B 1
  1022. Usage, syntax or configuration file error.
  1023. .TP
  1024. .B 2
  1025. Operational error.
  1026. .TP
  1027. .B 3
  1028. A child process returned a non-zero exit status.
  1029. .TP
  1030. .B 16
  1031. At least one of the pages/files/keywords didn't exist or wasn't matched.
  1032. .SH ENVIRONMENT
  1033. .\".TP \w'MANROFFSEQ\ \ 'u
  1034. .TP
  1035. .B MANPATH
  1036. If
  1037. .RB $ MANPATH
  1038. is set, its value is used as the path to search for manual pages.
  1039. .TP
  1040. .B MANROFFOPT
  1041. Every time
  1042. .B man
  1043. invokes the formatter
  1044. .RB ( nroff ,
  1045. .BR troff ,
  1046. or
  1047. .BR groff ),
  1048. it adds the contents of
  1049. .RB $ MANROFFOPT
  1050. to the formatter's command line.
  1051. .TP
  1052. .B MANROFFSEQ
  1053. If
  1054. .RB $ MANROFFSEQ
  1055. is set, its value is used to determine the set of preprocessors to pass
  1056. each manual page through.
  1057. The default preprocessor list is system dependent.
  1058. .TP
  1059. .B MANSECT
  1060. If
  1061. .RB $ MANSECT
  1062. is set, its value is a colon-delimited list of sections and it is used to
  1063. determine which manual sections to search and in what order.
  1064. The default is
  1065. "1 n l 8 3 2 3posix 3pm 3perl 3am 5 4 9 6 7",
  1066. unless overridden by the
  1067. .B SECTION
  1068. directive in
  1069. .IR /etc/manpath.config .
  1070. .TP
  1071. .BR MANPAGER , " PAGER"
  1072. If
  1073. .RB $ MANPAGER
  1074. or
  1075. .RB $ PAGER
  1076. is set
  1077. .RB ($ MANPAGER
  1078. is used in preference), its value is used as the name of the program used to
  1079. display the manual page.
  1080. By default,
  1081. .B pager
  1082. is used, falling back to
  1083. .B cat
  1084. if
  1085. .B pager
  1086. is not found or is not executable.
  1087. The value may be a simple command name or a command with arguments, and may
  1088. use shell quoting (backslashes, single quotes, or double quotes).
  1089. It may not use pipes to connect multiple commands; if you need that, use a
  1090. wrapper script, which may take the file to display either as an argument or
  1091. on standard input.
  1092. .TP
  1093. .B MANLESS
  1094. If
  1095. .RB $ MANLESS
  1096. is set, its value will be used as the default prompt string for the
  1097. .B less
  1098. pager, as if it had been passed using the
  1099. .B \-r
  1100. option (so any occurrences of the text
  1101. .B $MAN_PN
  1102. will be expanded in the same way).
  1103. For example, if you want to set the prompt string unconditionally to
  1104. \(lqmy prompt string\(rq, set
  1105. .RB $ MANLESS
  1106. to
  1107. .RB \(oq \-Psmy\ prompt\ string \(cq.
  1108. Using the
  1109. .B \-r
  1110. option overrides this environment variable.
  1111. .TP
  1112. .B BROWSER
  1113. If
  1114. .RB $ BROWSER
  1115. is set, its value is a colon-delimited list of commands, each of which in
  1116. turn is used to try to start a web browser for
  1117. .B man
  1118. .BR \-\-html .
  1119. In each command,
  1120. .I %s
  1121. is replaced by a filename containing the HTML output from
  1122. .BR groff ,
  1123. .I %%
  1124. is replaced by a single percent sign (%), and
  1125. .I %c
  1126. is replaced by a colon (:).
  1127. .TP
  1128. .B SYSTEM
  1129. If
  1130. .RB $ SYSTEM
  1131. is set, it will have the same effect as if it had been specified as the
  1132. argument to the
  1133. .B \-m
  1134. option.
  1135. .TP
  1136. .B MANOPT
  1137. If
  1138. .RB $ MANOPT
  1139. is set, it will be parsed prior to
  1140. .B man's
  1141. command line and is expected to be in a similar format.
  1142. As all of the other
  1143. .B man
  1144. specific environment variables can be expressed as command line options, and
  1145. are thus candidates for being included in
  1146. .RB $ MANOPT
  1147. it is expected that they will become obsolete.
  1148. N.B. All spaces that should be interpreted as part of an option's argument
  1149. must be escaped.
  1150. .TP
  1151. .B MANWIDTH
  1152. If
  1153. .RB $ MANWIDTH
  1154. is set, its value is used as the line length for which manual pages should
  1155. be formatted.
  1156. If it is not set, manual pages will be formatted with a line length
  1157. appropriate to the current terminal (using the value of
  1158. .RB $ COLUMNS ,
  1159. and
  1160. .BR ioctl (2)
  1161. if available, or falling back to 80 characters if neither is available).
  1162. Cat pages will only be saved when the default formatting can be used, that
  1163. is when the terminal line length is between 66 and 80 characters.
  1164. .TP
  1165. .B MAN_KEEP_FORMATTING
  1166. Normally, when output is not being directed to a terminal (such as to a file
  1167. or a pipe), formatting characters are discarded to make it easier to read
  1168. the result without special tools.
  1169. However, if
  1170. .RB $ MAN_KEEP_FORMATTING
  1171. is set to any non-empty value, these formatting characters are retained.
  1172. This may be useful for wrappers around
  1173. .B man
  1174. that can interpret formatting characters.
  1175. .TP
  1176. .B MAN_KEEP_STDERR
  1177. Normally, when output is being directed to a terminal (usually to a pager),
  1178. any error output from the command used to produce formatted versions of
  1179. manual pages is discarded to avoid interfering with the pager's display.
  1180. Programs such as
  1181. .B groff
  1182. often produce relatively minor error messages about typographical problems
  1183. such as poor alignment, which are unsightly and generally confusing when
  1184. displayed along with the manual page.
  1185. However, some users want to see them anyway, so, if
  1186. .RB $ MAN_KEEP_STDERR
  1187. is set to any non-empty value, error output will be displayed as usual.
  1188. .TP
  1189. .BR LANG , " LC_MESSAGES"
  1190. Depending on system and implementation, either or both of
  1191. .RB $ LANG
  1192. and
  1193. .RB $ LC_MESSAGES
  1194. will be interrogated for the current message locale.
  1195. .B man
  1196. will display its messages in that locale (if available).
  1197. See
  1198. .BR setlocale (3)
  1199. for precise details.
  1200. .SH FILES
  1201. .TP
  1202. .I /etc/manpath.config
  1203. man-db configuration file.
  1204. .TP
  1205. .I /usr/share/man
  1206. A global manual page hierarchy.
  1207. .SH "SEE ALSO"
  1208. .BR apropos (1),
  1209. .BR groff (1),
  1210. .BR less (1),
  1211. .BR manpath (1),
  1212. .BR nroff (1),
  1213. .BR troff (1),
  1214. .BR whatis (1),
  1215. .BR zsoelim (1),
  1216. .BR manpath (5),
  1217. .BR man (7),
  1218. .BR catman (8),
  1219. .BR mandb (8)
  1220. .PP
  1221. Documentation for some packages may be available in other formats, such as
  1222. .BR info (1)
  1223. or HTML.
  1224. .SH HISTORY
  1225. 1990, 1991 \(en Originally written by John W.\& Eaton (jwe@che.utexas.edu).
  1226. Dec 23 1992: Rik Faith (faith@cs.unc.edu) applied bug fixes
  1227. supplied by Willem Kasdorp (wkasdo@nikhefk.nikef.nl).
  1228. 30th April 1994 \(en 23rd February 2000: Wilf.\& (G.Wilford@ee.surrey.ac.uk)
  1229. has been developing and maintaining this package
  1230. with the help of a few dedicated people.
  1231. 30th October 1996 \(en 30th March 2001: Fabrizio Polacco <fpolacco@debian.org>
  1232. maintained and enhanced this package for the Debian project, with the
  1233. help of all the community.
  1234. 31st March 2001 \(en present day: Colin Watson <cjwatson@debian.org> is now
  1235. developing and maintaining man-db.