Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.