Quantcast
Channel: User Kamil Maciorowski - Super User
Viewing all articles
Browse latest Browse all 645

Answer by Kamil Maciorowski for Is there a `man/` equivalent of $PATH (which is for extra `bin/` directories)?

$
0
0

The "equivalent" of $PATH is $MANPATH. See man 1 man:

MANPATH

If $MANPATH is set, its value is used as the path to search for manual pages.

See the SEARCH PATH section of manpath(5) for the default behaviour and details of how this environment variable is handled.

Maybe you don't need to use $MANPATH; consider relying on the default behaviour. The most relevant fragments of man 5 manpath:

By default, man-db examines the user's $PATH. For each path_element found there, it adds manpath_element to the search path.

If there is no MANPATH_MAP line in the configuration file for a given path_element, then it adds all of path_element/../man, path_element/man, path_element/../share/man, and path_element/share/man that exist as directories to the search path.

It then adds any MANDATORY_MANPATH entries from the configuration file to the search path.

[…]

The $MANPATH environment variable overrides man-db's default manual page search paths. Most users should not need to set it. Its syntax is similar to the $PATH environment variable: it consists of a sequence of directory names separated by colons. It overrides the default search path […].

If the value of $MANPATH starts with a colon, then the default search path is added at its start. If the value of $MANPATH ends with a colon, then the default search path is added at its end. If the value of $MANPATH contains a double colon (::), then the default search path is inserted in the middle of the value, between the two colons.

There is also a command manpath. It may be useful in debugging your setup.

The links in this answer point to manpages of Ubuntu. In general refer to documentation and manuals of your specific distro.


Viewing all articles
Browse latest Browse all 645

Trending Articles