In order to retrieve a man page it must be found in the manpath
. The directories that are listed by the manpath
are set by /etc/manpath.config
. This can be overwritten via an environment variable $MANPATH
. If the man page you are looking for is in this path already, then you should see a listing like the following:
stat (1)
stat (2)
stat (3p)
stat (3p+2)
That (3p+2) represents a duplicated entry. Since you believe you have two different man pages, you should see something like this. If not, then the man page you want either does not exist on your system, or is outside of the manpath. You can specify a custom manpath
with the -M
option. This will override the $MANPATH
variable. From the man man
:
-M path, --manpath=path
Specify an alternate manpath to use. By default, man uses manpath derived code to determine the path to search. This option overrides the $MANPATH environment variable and causes option -m to be ignored.
A path specified as a manpath must be the root of a manual page hierarchy structured into sections as described in the man-db manual (under "The manual page system"). To view manual pages outside such hierarchies, see the -l option.