There's no real way to fully answer your question in general for various operating systems, as the
man implementation isn't really that fully specified.
The POSIX-standard, non-Linux-specific answer can be found in the POSIX
man - display system documentation
man [-k] name...
The following environment variables shall affect the execution of man:
Provide a default value for the internationalization variables that
are unset or null. (See XBD Internationalization Variables for the
precedence of internationalization variables used to determine the
values of locale categories.)
If set to a non-empty string value, override the values of all the
other internationalization variables.
Determine the locale for the interpretation of sequences of bytes of
text data as characters (for example, single-byte as opposed to
multi-byte characters in arguments and in the summary database). The
value of LC_CTYPE need not affect the format of the information
written about the name operands.
Determine the locale that should be used to affect the format and
contents of diagnostic messages written to standard error and
informative messages written to standard output.
Determine the location of message catalogs for the processing of
Determine an output filtering command for writing the output to a
terminal. Any string acceptable as a command_string operand to the
-c command shall be valid. When standard output is a
terminal device, the reference page output shall be piped through the
command. If the PAGER variable is null or not set, the command shall
more or another paginator utility documented in the
Note the RATIONALE section, describing why
man isn't so fully specified:
It is recognized that the man utility is only of minimal usefulness as
specified. The opinion of the standard developers was strongly divided
as to how much or how little information man should be required to
provide. They considered, however, that the provision of some portable
way of accessing documentation would aid user portability. The
arguments against a fuller specification were:
Large quantities of documentation should not be required on a system that does not have excess disk space.
The current manual system does not present information in a manner that greatly aids user portability.
A "better help system" is currently an area in which vendors feel that they can add value to their POSIX implementations.
The -f option was considered, but due to implementation differences,
it was not included in this volume of POSIX.1-2008.
The description was changed to be more specific about what has to be
displayed for a utility. The standard developers considered it
insufficient to allow a display of only the synopsis without giving a
short description of what each option and operand does.
The "purpose" entry to be included in the database can be similar to
the section title (less the numeric prefix) from this volume of
POSIX.1-2008 for each utility. These titles are similar to those used
in historical systems for this purpose.
See mailx for rationale concerning the default paginator.
The caveat in the LC_CTYPE description was added because it is not a
requirement that an implementation provide reference pages for all of
its supported locales on each system; changing LC_CTYPE does not
necessarily translate the reference page into another language. This
is equivalent to the current state of LC_MESSAGES in
POSIX.1-2008-locale-specific messages are not yet a requirement.
The historical MANPATH variable is not included in POSIX because no
attempt is made to specify naming conventions for reference page
files, nor even to mandate that they are files at all. On some
implementations they could be a true database, a hypertext file, or
even fixed strings within the man executable. The standard developers
considered the portability of reference pages to be outside their
scope of work. However, users should be aware that MANPATH is
implemented on a number of historical systems and that it can be used
to tailor the search pattern for reference pages from the various
categories (utilities, functions, file formats, and so on) when the
system administrator reveals the location and conventions for
reference pages on the system.
The paginator rationale discussion from the mailx page:
The paginator selected when PAGER is null or unset is partially
unspecified to allow the System V historical practice of using pg as
the default. Bypassing the pagination function, such as by declaring
that cat is the paginator, would not meet with the intended meaning of
this description. However, any "portable user" would have to set PAGER
explicitly to get his or her preferred paginator on all systems. The
paginator choice was made partially unspecified, unlike the VISUAL
editor choice (mandated to be vi) because most historical pagers
follow a common theme of user input, whereas editors differ