Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In my environment, I am installing a different vendor SSH server other than openSSH tended to meet our environment needs. When I issue a man ssh command, for example, I want it to point to the new vendor ssh server man page, rather than the openssh man page. The only way I have seen to do it so far is to physically copy all the man pages from the new ssh server to the /usr/local/man directory. Does anyone know of an easier/cleaner way to do this, such as a configuration file to point man to look the new man entries where I would provide a directory?

share|improve this question
up vote 1 down vote accepted

You can control what man looks for using the environment variable MANPATH. Works the same way the PATH variable works. Directories are separated by colons, i.e. ":". Just prepend directories to the beginning of it to override where man looks for man pages.

in a bash shell:

% export MANPATH=/some/new/dir:$MANPATH

You can see what it's set to with this command:

% echo $MANPATH

Don't be surprised if it's empty. man makes use of a config file, /etc/man.config which drives where man should look for man pages. It will have entries like this:

MANPATH /usr/man
MANPATH /usr/share/man
MANPATH /usr/local/man
MANPATH /usr/local/share/man

You can see the effect of these entries along with your MANPATH variable with the command manpath.

% echo $MANPATH

% manpath
/usr/kerberos/man:/usr/local/share/man:/usr/share/man/en:/usr/share/man:/usr/local/man
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .