MAN(1)

๐Ÿ“– MAN(1) โœจ Manual pager utils โœจ MAN(1)

๐ŸŒธ NAME ๐ŸŒธ

okay so the name of this thing is man, and it's basically your gateway to the system reference manuals ๐Ÿ“š bestie, it's literally an interface to all the official docs ๐Ÿ’–

๐ŸŽ€ SYNOPSIS ๐ŸŽ€

man [man options] [[section] page ...] ...
man -k [apropos options] regexp ...
man -K [man options] [section] term ...
man -f [whatis options] page ...
man -l [man options] file ...
man -w|-W [man options] page ...

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

okay so man is the system's manual pager ๐Ÿ’… You give it a page argument, which is usually the name of a program, utility, or function, and it goes and finds the manual page for that thing and shows it to you. โœจ

You can also give it a section, if you want. That tells man to only look in that one section of the manual ๐Ÿงš Without one, it searches all the available sections following a pre-defined order (see DEFAULTS ๐Ÿ‘‘) and shows you only the first page it finds. Even if the page exists in several sections, you only get one, so no double-dipping ๐Ÿ™ˆ

The table below shows the section numbers of the manual and the types of pages they hold. Lowkey the most useful thing to memorise ๐Ÿ“

  • 1 โ€” Executable programs or shell commands ๐Ÿ”ฅ
  • 2 โ€” System calls (functions provided by the kernel) ๐Ÿ’œ
  • 3 โ€” Library calls (functions within program libraries) ๐ŸŒˆ
  • 4 โ€” Special files (usually found in /dev) โญ
  • 5 โ€” File formats and conventions, e.g. /etc/passwd ๐Ÿซถ
  • 6 โ€” Games ๐ŸŽฎ
  • 7 โ€” Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7), man-pages(7) ๐Ÿ’–
  • 8 โ€” System administration commands (usually only for root) ๐Ÿ’€
  • 9 โ€” Kernel routines [Non standard] ๐Ÿ™ˆ

A manual page is made up of several sections, kind of like a playlist of info ๐ŸŽ€

Conventional section names include NAME, SYNOPSIS, CONFIGURATION, DESCRIPTION, OPTIONS, EXIT STATUS, RETURN VALUE, ERRORS, ENVIRONMENT, FILES, VERSIONS, STANDARDS, NOTES, BUGS, EXAMPLE, AUTHORS, and SEE ALSO โœจ

The following conventions apply to the SYNOPSIS section, and you can use them as a guide in other sections too ๐Ÿ’…

  • bold text โ€” type exactly as shown.
  • italic text โ€” replace with the appropriate argument.
  • [-abc] โ€” any or all arguments within [ ] are optional.
  • -a|-b โ€” options delimited by | cannot be used together.
  • argument ... โ€” argument is repeatable.
  • [expression] ... โ€” the entire expression within [ ] is repeatable.

Exact rendering may vary depending on the output device. For instance, man will usually not be able to render italics when running in a terminal, and will typically use underlined or coloured text instead ๐ŸŒธ

The command or function illustration is a pattern that should match all possible invocations. In some cases it is advisable to illustrate several exclusive invocations, as is shown in the SYNOPSIS section of this manual page ๐Ÿฆ‹

๐Ÿ“ EXAMPLES ๐Ÿ“

bestie, this is the fun part ๐Ÿคฉ here are the examples, served fresh:

man ls

Display the manual page for the item (program) ls. ๐Ÿ’–

man man.7

Display the manual page for macro package man from section 7. (This is an alternative spelling of "man 7 man".) โœจ

man 'man(7)'

Display the manual page for macro package man from section 7. (This is another alternative spelling of "man 7 man". It may be more convenient when copying and pasting cross-references to manual pages. Note that the parentheses must normally be quoted to protect them from the shell.) ๐Ÿงš

man -a intro

Display, in succession, all of the available intro manual pages contained within the manual. It is possible to quit between successive displays or skip any of them. ๐ŸŒˆ

man -t bash | lpr -Pps

Format the manual page for bash into the default troff or groff format and pipe it to the printer named ps. The default output for groff is usually PostScript. man --help should advise as to which processor is bound to the -t option. ๐Ÿ–จ๏ธ

man -l -Tdvi ./foo.1x.gz > ./foo.1x.dvi

This command will decompress and format the nroff source manual page ./foo.1x.gz into a device independent (dvi) file. The redirection is necessary, as the -T flag causes output to be directed to stdout with no pager. The output could be viewed with a program such as xdvi, or further processed into PostScript using a program such as dvips. ๐Ÿ’…

man -k printf

Search the short descriptions and manual page names for the keyword printf as a regular expression. Print out any matches. Equivalent to apropos printf. ๐Ÿ”ฅ

man -f smail

Look up the manual pages referenced by smail and print out the short descriptions of any found. Equivalent to whatis smail. ๐Ÿซถ


๐Ÿงš OVERVIEW ๐Ÿงš

okay so there are so many options available to man, giving you as much flexibility as possible ๐Ÿ’œ You can change the search path, section order, output processor, and other behaviours and operations detailed below. Main character energy ๐Ÿ‘‘

If they're set, various environment variables get interrogated to determine how man operates ๐ŸŒธ You can set the "catch-all" variable $MANOPT to any string in command line format, with one exception: any spaces used as part of an option's argument must be escaped (preceded by a backslash) ๐Ÿ™ˆ man will parse $MANOPT before parsing its own command line. Options that require an argument will be overridden by the same options found on the command line. To reset all of the options set in $MANOPT, -D can be specified as the initial command line option. This lets man "forget" about the options specified in $MANOPT, although they must still have been valid when set โœจ

Manual pages are normally stored in nroff(1) format under a directory such as /usr/share/man. In some installations there may also be preformatted cat pages to improve performance. See manpath(5) for details of where these files are stored ๐Ÿ“š

This package supports manual pages in multiple languages, controlled by your locale ๐ŸŒ If your system didn't set this up for you automatically, you may need to set $LC_MESSAGES, $LANG, or another system-dependent environment variable to indicate your preferred locale. This is usually specified in the POSIX format:

<language>[_<territory>[.<character-set>[,<version>]]]

If the desired page is available in your locale, it will be displayed in lieu of the standard (usually American English) page ๐ŸŽ€

If you find that the translations supplied with this package aren't available in your native language, and you'd like to supply them, please contact the maintainer, who will be coordinating that activity ๐Ÿซถ

Individual manual pages are normally written and maintained by the maintainers of the program, function, or other topic they document, and they are not included with this package. If you find that a manual page is missing or inadequate, please report that to the maintainers of the package in question ๐Ÿ’Œ

For information regarding other features and extensions available with this manual pager, please read the documents supplied with the package ๐Ÿฆ‹

๐Ÿ‘‘ DEFAULTS ๐Ÿ‘‘

The order of sections to search may be overridden by the environment variable $MANSECT, or by the SECTION directive in /etc/manpath.config. By default it is as follows:

1 n l 8 3 0 2 3type 3posix 3pm 3perl 3am 5 4 9 6 7

The formatted manual page is displayed using a pager. This can be specified in a number of ways, or else it will fall back to a default (see option -P for details) ๐Ÿ’–

The filters are deciphered by a number of means. Firstly, the command line option -p or the environment variable $MANROFFSEQ is interrogated. If -p was not used and the environment variable was not set, the initial line of the nroff file is parsed for a preprocessor string. To contain a valid preprocessor string, the first line must resemble:

'\" <string>

where string can be any combination of letters described by option -p below โœจ

If none of the above methods provide any filter information, a default set is used ๐ŸŒธ

A formatting pipeline is formed from the filters and the primary formatter (nroff, or [tg]roff with -t) and executed. Alternatively, if an executable program mandb_nfmt (or mandb_tfmt with -t) exists in the man tree root, it is executed instead. It gets passed the manual source file, the preprocessor string, and optionally the device specified with -T or -E as arguments ๐Ÿงš

๐ŸŽ€ OPTIONS ๐ŸŽ€

okay bestie, listen up ๐Ÿ‘‚ Non-argument options that are duplicated, either on the command line, in $MANOPT, or both, are totally harmless ๐Ÿซถ For options that do require an argument, each duplication will override the previous argument value.

๐Ÿ’œ General options ๐Ÿ’œ

  • -C file, --config-file=file โ€” Use this user configuration file rather than the default of ~/.manpath. ๐ŸŒˆ
  • -d, --debug โ€” Print debugging information. ๐Ÿ”
  • -D, --default โ€” This option is normally issued as the very first option, and it resets man's behaviour to its default. Its whole job is to reset those options that may have been set in $MANOPT. Any options that follow -D will have their usual effect. ๐Ÿ”„
  • --warnings[=warnings] โ€” Enable warnings from groff. This can be used to perform sanity checks on the source text of manual pages. warnings is a comma-separated list of warning names; if it isn't supplied, the default is "mac". To disable a groff warning, prefix it with "!": for example, --warnings=mac,!break enables warnings in the "mac" category and disables warnings in the "break" category. See the โ€œWarningsโ€ node in info groff for a list of available warning names. โš ๏ธ

๐Ÿ”ฅ Main modes of operation ๐Ÿ”ฅ

  • -f, --whatis โ€” Approximately equivalent to whatis. Displays a short description from the manual page, if one is available. See whatis(1) for details. โœจ
  • -k, --apropos โ€” Approximately equivalent to apropos. Searches the short manual page descriptions for keywords and displays any matches. See apropos(1) for details. ๐Ÿ”Ž
  • -K, --global-apropos โ€” Searches for text in all manual pages. This is a brute-force search and is likely to take some time, so if you can, specify a section to reduce the number of pages that need to be searched. Search terms may be simple strings (the default), or regular expressions if the --regex option is used. ๐Ÿ’€
heads up bestie: this searches the sources of the manual pages, not the rendered text. That means it may include false positives due to things like comments in source files, or false negatives due to things like hyphens being written as "\-" in source files. Searching the rendered text would be much slower ๐Ÿ™ˆ
  • -l, --local-file โ€” Activate "local" mode. Format and display local manual files instead of searching through the system's manual collection ๐Ÿง Each manual page argument will be interpreted as an nroff source file in the correct format. No cat file is produced. If '-' is listed as one of the arguments, input will be taken from stdin ๐Ÿ“ฅ

Okay so the -l business from before is still going, and it's giving "fallback" ๐Ÿฆ‹

If this option isn't used, man will also fall back to treating page arguments as local file names whenever the argument contains a / character ๐Ÿ—‚๏ธ bestie, that slash is basically a neon sign saying "this is a path on the file system" โœจ


  • -w, --where, --path, --location โ€” okay so this one doesn't actually show you the page ๐Ÿ™ˆ it just prints the location of the source nroff file that would've been formatted. If you also throw in -a, it prints the locations of all source files that match your search ๐Ÿ”๐Ÿ’œ
  • -W, --where-cat, --location-cat โ€” same energy as -w, but for the preformatted cat file that would've been displayed ๐Ÿ“„ With -a you get the locations of every preformatted cat file that matches ๐ŸŒธ
  • Now the combo moment ๐Ÿซถ If you use -w and -W together, you get both the source file and the cat file, separated by a space. And if you use all of -w, -W, and -a at once, it does this for each possible match. Iconic, honestly ๐Ÿ‘‘
  • -c, --catman โ€” not for general use, bestie ๐Ÿ™…โ€โ™€๏ธ This one's only meant for the catman program, so please don't go poking it for fun ๐Ÿ’€
  • -R encoding, --recode=encoding โ€” instead of formatting the page the usual way, this outputs its source converted to the encoding you specify ๐ŸŒˆ If you already know the source file's encoding, you can use manconv(1) directly. BUT this option is the move if you want to convert a bunch of pages to one encoding without stating each one's encoding, as long as they're already installed in something shaped like a manual page hierarchy โœจ
  • Quick heads up ๐Ÿ’… For converting multiple manual pages, man-recode(1) is the better pick. It has an interface built for bulk conversion, so it can be way faster ๐ŸŽ๏ธ๐Ÿ’จ

๐Ÿฆ‹ Finding manual pages ๐Ÿฆ‹

  • -L locale, --locale=locale โ€” normally man figures out your current locale by calling the C function setlocale(3), which checks various environment variables (possibly including $LC_MESSAGES and $LANG) ๐ŸŒ If you want to temporarily override that, pass a locale string straight to man with this option. It won't kick in until the page search actually begins, though ๐Ÿ• And output like the help message always shows up in the locale that was figured out at the start ๐Ÿ’–
  • -m system[,...], --systems=system[,...] โ€” if your system can access other operating systems' manual pages, this is how you reach them ๐Ÿงš To search NewOS's manual page collection, use -m NewOS. You can list several operating system names separated by commas, and to include a search of the native operating system's pages, add the system name man to the argument string ๐Ÿซถ This option overrides the $SYSTEM environment variable, so it wins that fight ๐Ÿ‘‘
  • -M path, --manpath=path โ€” lets you pick an alternate manpath to use ๐Ÿ—บ๏ธ By default, man uses manpath-derived code to figure out which path to search. This option overrides the $MANPATH environment variable AND makes -m get ignored. Rude, but effective ๐Ÿ’€

A path given as a manpath has to be the root of a manual page hierarchy that's structured into sections, just like the man-db manual describes (look for "The manual page system") ๐Ÿ“š Want to view pages that live outside those hierarchies? Check out the -l option โœจ

  • -S list, -s list, --sections=list โ€” the list is a colon- or comma-separated list of sections that decides which manual sections get searched and in what order ๐ŸŽ€ This overrides the $MANSECT environment variable. (The -s spelling is only there for compatibility with System V, so it's a bit of a throwback ๐Ÿ•ฐ๏ธ)
  • -e sub-extension, --extension=sub-extension โ€” okay this one has a whole story ๐Ÿ“– Some systems stuff big packages of manual pages, like the ones that come with the Tcl package, into the main hierarchy. So to avoid two pages sharing a name like exit(3), the Tcl pages were usually all dumped into section l. Unfortunate, honestly ๐Ÿ˜ญ Now it's possible to put them in the correct section and give them a specific "extension", like exit(3tcl). By default, man shows exit(3) in preference to exit(3tcl). So to get the Tcl one without needing to know which section it lives in, give man a sub-extension string for the package. Using the example above, -e tcl restricts the search to pages with an extension of *tcl ๐Ÿ’…
  • -i, --ignore-case โ€” ignores case when searching for pages. This is the default, so you're already doing it ๐ŸŒธ
  • -I, --match-case โ€” searches case-sensitively ๐Ÿ”ค
  • --regex โ€” shows all pages where any part of the name or the description matches each page argument as a regular expression, same as apropos(1) ๐Ÿ” Since there's usually no reasonable way to pick a "best" page for a regex search, this option implies -a ๐Ÿซถ
  • --wildcard โ€” same vibe as --regex, but uses shell-style wildcards, same as apropos(1) --wildcard ๐Ÿงš The page argument has to match the entire name or description, or match on word boundaries in the description. And just like --regex, this one implies -a because there's no obvious "best" page for a wildcard either ๐Ÿ’–
  • --names-only โ€” if you're using --regex or --wildcard, this matches only page names and skips descriptions, same as whatis(1) โœจ Otherwise it does nothing, so don't stress ๐Ÿ™ˆ
  • -a, --all โ€” by default, man exits after showing the most suitable page it finds ๐Ÿ With this option, it shows all the manual pages whose names match your search criteria ๐ŸŒˆ
  • -u, --update โ€” makes man update its database caches of installed manual pages ๐Ÿ› ๏ธ This is only needed in rare situations, and it's usually better to run mandb(8) instead ๐Ÿ’œ
  • --no-subpages โ€” okay this is a lowkey clever one ๐Ÿง  By default, man treats a pair of manual page names on the command line as equivalent to a single page name containing a hyphen or an underscore. This is for programs with a bunch of subcommands, so each one can have its own page that you look up with the same syntax you'd use to run the subcommand itself. For example:
$ man -aw git diff
/usr/share/man/man1/git-diff.1.gz

To turn that behaviour off, use --no-subpages ๐Ÿ™…โ€โ™€๏ธ

$ man -aw --no-subpages git diff
/usr/share/man/man1/git.1.gz
/usr/share/man/man3/Git.3pm.gz
/usr/share/man/man1/diff.1.gz

๐ŸŽ€ Controlling formatted output ๐ŸŽ€

  • -P pager, --pager=pager โ€” picks the output pager ๐Ÿ“„ By default, man uses pager, but falls back to cat if pager isn't found or isn't executable ๐Ÿฑ This option overrides the $MANPAGER environment variable, which in turn overrides the $PAGER environment variable. It's not used with -f or -k ๐Ÿ™ˆ

The value can be a simple command name or a command with arguments, and it can use shell quoting (backslashes, single quotes, or double quotes) โœจ BUT it can't use pipes to connect multiple commands. If you need that, make a wrapper script instead. The script can take the file to display either as an argument or on standard input ๐Ÿซถ

  • -r prompt, --prompt=prompt โ€” if you're using a recent version of less as your pager, man will try to set its prompt and some sensible options for you ๐ŸŒธ The default prompt looks like this:

Manual page name(sec) line x

Where name is the manual page name, sec is the section it was found under, and x is the current line number ๐Ÿ”ข This is achieved by using the $LESS environment variable ๐Ÿ’…

Supplying -r with a string overrides that default ๐ŸŒˆ The string can include the text $MAN_PN, which gets expanded to the name of the current manual page, plus its section name wrapped in ( and ). The string used to make the default could be written like this:

\ Manual\ page\ \$MAN_PN\ ?ltline\ %lt?L/%L.:
byte\ %bB?s/%s..?\ (END):?pB\ %pB\\%..
(press h for help or q to quit)

It's split into three lines here just for readability โœจ For what it all means, see the less(1) manual page ๐Ÿ“– The prompt string gets evaluated by the shell first, so all double quotes, backquotes and backslashes in the prompt must be escaped with a preceding backslash ๐Ÿ™ The prompt string may end in an escaped $, which can be followed by more options for less. By default, man sets the -ix8 options ๐Ÿ’–

The $MANLESS environment variable (described below) can set a default prompt string if you don't supply one on the command line. Choose wisely, bestie ๐Ÿ‘‘
  • -7, --ascii โ€” when you're viewing a pure ascii(7) manual page on a 7-bit terminal or terminal emulator, some characters might not display correctly when using the latin1(7) device description with GNU nroff ๐Ÿ˜ญ This option lets pure ascii pages display in ascii with the latin1 device. It won't translate any latin1 text, though ๐Ÿ™…โ€โ™€๏ธ Here's the table of translations it performs. Some parts might only display properly with GNU nroff's latin1(7) device:
Description           Octal   latin1   ascii
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
continuation hyphen    255      โ€        -
bullet (middle dot)    267      โ€ข        o
acute accent           264      ยด        '
multiplication sign    327      ร—        x

If the latin1 column displays correctly, your terminal is probably set up for latin1 characters and you don't need this option ๐ŸŒˆ If the latin1 and ascii columns are identical, then you're either reading this page using this option, or man didn't format it with the latin1 device description ๐Ÿค” And if the latin1 column is missing or corrupt, you might need to view manual pages with this option ๐Ÿฅบ

This option is ignored when you use -t, -H, -T, or -Z, and it might be totally useless for nroff unless it's GNU's ๐Ÿ™„โœจ

  • -E encoding, --encoding=encoding: okay so this one makes output for a character encoding that isn't the default ๐Ÿ’– For backward compatibility, encoding can be an nroff device like ascii, latin1, or utf8, or a real character encoding like UTF-8. Both work bestie ๐Ÿซถ
  • --no-hyphenation, --nh: so normally nroff will hyphenate words at line breaks, even words with no hyphens in them, if it needs to so the line doesn't look gappy ๐Ÿ“ This option turns that off, so words only get hyphenated if they already have hyphens in them ๐Ÿฆ‹

If you're writing a manual page and just want to stop nroff from hyphenating a word in a weird spot, don't use this flag ๐Ÿ™…โ€โ™€๏ธ Check the nroff docs instead. For example, you can put "\%" inside a word to say where it's allowed to break, or put "\%" at the start of a word so it never gets hyphenated ๐Ÿ’…

  • --no-justification, --nj: normally nroff pushes text out to both margins so it's perfectly lined up on both sides ๐Ÿ“ This option turns off full justification and keeps only the left margin lined up, which is what people call "ragged-right" text ๐ŸŽ€

Same deal as before: if you only want certain paragraphs to stop being justified, skip this flag and read the nroff docs. You can use the .na, .nf, .fi, and .ad requests to turn adjusting and filling off temporarily โœจ

  • -p string, --preprocessor=string: this sets which preprocessors run before nroff or troff/groff ๐Ÿงš Not every setup has the full set, so don't be shocked if some are missing. The ones you might see, with their letters, are: eqn (e), grap (g), pic (p), tbl (t), vgrind (v), and refer (r) ๐Ÿ“š This option overrides the $MANROFFSEQ environment variable, and zsoelim always runs first no matter what ๐Ÿ‘‘
  • -t, --troff: formats the manual page with groff -mandoc and sends it to stdout ๐Ÿ–จ๏ธ You don't need this flag if you're already using -H, -T, or -Z ๐Ÿ’œ
  • -T[device], --troff-device[=device]: changes groff's output (or possibly troff's) so it's suitable for a device that isn't the default ๐Ÿ“ฑ It implies -t. Some examples as of groff 1.23.0 are dvi, latin1, pdf, ps, utf8, X75, and X100 ๐ŸŒˆ
  • -H[browser], --html[=browser]: makes groff produce HTML and then shows it in a web browser ๐ŸŒ The browser gets picked by the optional browser argument if you give one, otherwise by the $BROWSER environment variable, and if that's unset, by a compile-time default (usually lynx). This option implies -t and only works with GNU troff ๐Ÿฆ‹
  • -X[dpi], --gxditview[=dpi]: shows groff's output in a graphical window using the gxditview program ๐ŸชŸ The dpi (dots per inch) can be 75, 75-12, 100, or 100-12, and it defaults to 75. The -12 versions use a 12-point base font. This option implies -T with the X75, X75-12, X100, or X100-12 device, depending on what you pick ๐Ÿ”ฅ
  • -Z, --ditroff: groff runs troff, then uses a suitable post-processor to make output for the device you chose ๐Ÿซง If groff -mandoc is groff, this option gets passed along to groff and stops the post-processor from running. It implies -t ๐Ÿ’€

๐Ÿ’ฌ Getting help

  • -?, --help: prints a help message and exits ๐Ÿ™‹โ€โ™€๏ธ
  • --usage: prints a short usage message and exits ๐Ÿ“
  • -V, --version: displays version info ๐Ÿท๏ธ

๐Ÿšฆ EXIT STATUS ๐Ÿšฆ

  • 0: everything went perfectly, successful program execution ๐Ÿฅณ
  • 1: usage, syntax, or configuration file error ๐Ÿ™ˆ
  • 2: operational error ๐Ÿ˜ฌ
  • 3: a child process returned a non-zero exit status ๐Ÿ’€
  • 16: at least one of the pages, files, or keywords didn't exist or didn't get matched ๐Ÿซ 

๐ŸŒ ENVIRONMENT ๐ŸŒ

  • MANPATH: if $MANPATH is set, its value is the path man searches for manual pages ๐Ÿ—บ๏ธ See the SEARCH PATH section of manpath(5) for the default behaviour and the full details on how this variable is handled ๐Ÿ’…
  • MANROFFOPT: every time man calls the formatter (nroff, troff, or groff), it adds the contents of $MANROFFOPT to the formatter's command line โš™๏ธ For example, MANROFFOPT=-P-i tells the formatter to use italic text (only some terminals support that) instead of underlined text ๐ŸŒธ
  • MANROFFSEQ: if $MANROFFSEQ is set, its value decides which preprocessors each manual page goes through ๐Ÿงฉ The default preprocessor list depends on the system ๐Ÿ–ฅ๏ธ
  • MANSECT: if $MANSECT is set, its value is a colon-delimited list of sections, and it decides which manual sections get searched and in what order ๐Ÿ“‘ The default is "1 n l 8 3 0 2 3type 3posix 3pm 3perl 3am 5 4 9 6 7", unless the SECTION directive in /etc/manpath.config overrides it ๐Ÿซถ
  • MANPAGER, PAGER: if $MANPAGER or $PAGER is set ($MANPAGER wins if both are), its value is the program used to display the manual page ๐Ÿ“– By default it's pager, and it falls back to cat if pager isn't found or isn't executable ๐Ÿˆ

The value can be a plain command name or a command with arguments, and it can use shell quoting (backslashes, single quotes, or double quotes) ๐Ÿงต It can't use pipes to connect multiple commands. If you need that, use a wrapper script instead, which can take the file to display either as an argument or on standard input ๐ŸŽ€

  • MANLESS: if $MANLESS is set, its value becomes the default prompt string for the less pager, just as if you'd passed it with the -r option, so any $MAN_PN text gets expanded the same way ๐Ÿช„ For example, if you want the prompt to be โ€œmy prompt stringโ€ no matter what, set $MANLESS to -Psmy prompt string ๐Ÿ’– Using the -r option overrides this environment variable ๐Ÿ™Œ
  • BROWSER: if $BROWSER is set, its value is a colon-delimited list of commands. Each one gets tried in turn to start a web browser for man --html ๐ŸŒ In each command, %s gets replaced by a filename holding the HTML output from groff, %% gets replaced by a single percent sign (%), and %c gets replaced by a colon (:) ๐Ÿซง
  • SYSTEM: if $SYSTEM is set, it does the exact same thing as if you'd passed it as the argument to the -m option ๐Ÿงƒ
  • MANOPT: if $MANOPT is set, it gets parsed before man's command line and should look kind of similar to it ๐Ÿ“ All the other man-specific environment variables can be written as command line options, so they're all candidates to go into $MANOPT, which means they'll probably become obsolete ๐Ÿ‘‹ N.B. every space that's meant to be part of an option's argument must be escaped ๐Ÿšจ
  • MANWIDTH: if $MANWIDTH is set, its value is the line length manual pages get formatted to ๐Ÿ“ If it isn't set, pages get formatted to a line length that suits your current terminal, using $COLUMNS, plus ioctl(2) if it's available, and falling back to 80 characters if neither works ๐Ÿ’ป Cat pages only get saved when the default formatting can be used, which is when the terminal line length is between 66 and 80 characters ๐Ÿง 
  • MAN_KEEP_FORMATTING: normally, when output isn't going to a terminal (like a file or a pipe), formatting characters get tossed so the result is easy to read without special tools ๐Ÿงน But if $MAN_KEEP_FORMATTING is set to any non-empty value, those formatting characters stay put. This can be handy for wrappers around man that know how to interpret them ๐Ÿ”
  • MAN_KEEP_STDERR: normally, when output is going to a terminal (usually a pager), any error output from the command that makes the formatted pages gets thrown away so it doesn't mess up the pager's display ๐Ÿ™Š Programs like groff often spit out minor complaints about typography, like poor alignment, which look messy next to the page. But some people want to see them anyway, so if $MAN_KEEP_STDERR is set to any non-empty value, error output shows up as usual ๐Ÿ‘€
  • MAN_DISABLE_SECCOMP: on Linux, man normally puts subprocesses that handle untrusted data inside a seccomp(2) sandbox ๐Ÿ›ก๏ธ That makes it way safer to run complex parsing code over random manual pages. If this breaks for some reason that has nothing to do with the page's content, you can set $MAN_DISABLE_SECCOMP to any non-empty value to turn the sandbox off ๐Ÿ”“
  • PIPELINE_DEBUG: if $PIPELINE_DEBUG is set to "1", man prints debugging messages to standard error describing every subprocess it runs ๐Ÿ”Ž
  • LANG, LC_MESSAGES: depending on the system and implementation, either or both of $LANG and $LC_MESSAGES get checked for the current message locale ๐ŸŒ man shows its messages in that locale if it's available. See setlocale(3) for the precise details ๐Ÿงšโ€โ™€๏ธ

๐Ÿ“ FILES ๐Ÿ“

  • /etc/manpath.config: the man-db configuration file ๐Ÿ—‚๏ธ
  • /usr/share/man: a global manual page hierarchy ๐ŸŒธ

๐Ÿ“œ STANDARDS ๐Ÿ“œ

POSIX.1-2001, POSIX.1-2008, and POSIX.1-2017 โœจ


๐Ÿ”— SEE ALSO ๐Ÿ”—

apropos(1), groff(1), less(1), manpath(1), nroff(1), troff(1), whatis(1), zsoelim(1), manpath(5), man(7), catman(8), mandb(8) ๐Ÿ’œ

Documentation for some packages may also be available in other formats, like info(1) or HTML ๐Ÿซถ

๐Ÿ•ฐ๏ธ HISTORY ๐Ÿ•ฐ๏ธ

okay so this is the lore ๐Ÿ“œ of how man-db came to be, and it's kinda iconic ngl ๐Ÿ’…

1990, 1991 โ€“ it was originally written by John W. Eaton, email jwe@che.utexas.edu. the OG ๐Ÿซถ

Dec 23 1992: Rik Faith (faith@cs.unc.edu) applied bug fixes that Willem Kasdorp (wkasdo@nikhefk.nikef.nl) had supplied. literally a team effort ๐Ÿฅน

30th April 1994 โ€“ 23rd February 2000: Wilf. (G.Wilford@ee.surrey.ac.uk) kept developing and maintaining this package, with some dedicated people helping out. such a ride-or-die era โœจ

30th October 1996 โ€“ 30th March 2001: Fabrizio Polacco (<fpolacco@debian.org>) maintained and enhanced this package for the Debian project, with help from the whole community. the glow-up is real ๐ŸŒˆ

31st March 2001 โ€“ present day: Colin Watson (<cjwatson@debian.org>) is now the one developing and maintaining man-db. current queen of the codebase ๐Ÿ‘‘


๐Ÿ› BUGS ๐Ÿ›

if something's acting up, you can spill the tea at these places bestie ๐Ÿซ 


ok that's the whole page!! thanks for hanging with me through all of it ๐Ÿซถ๐Ÿ’– stay curious, stay caffeinated, and keep being the most iconic Unix girlie in the group chat ๐Ÿ’…๐Ÿฆ‹ version 2.13.1, last updated 2025-05-02 ๐ŸŽ€โœจ

๐Ÿ“ฆ where this page comes from