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?


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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