I have a directory which contains man page files and some other files:

$ ls doc
cheatsheet.svg  colorschemes.md  config   howto-publish-a-release.md  ranger.1
ranger.desktop  ranger.pod   rifle.1  rifle.pod           tools

The two files of interest are rifle.1 and ranger.1. I want to be able to do man ranger and view the manual entry for it. To this end, I add the location of doc to my $MANPATH

$ echo $MANPATH

Where the last 3 entries used to exist in $MANPATH before I touched it. I also tried to set $MANPATH to /path/to/doc and remove everything else. In either case, when I issue the man command, I get an error

$ man ranger
No manual entry for ranger

What am I doing wrong?


The manual pages must be organised into sections underneath a component of MANPATH. Pages in section 1 must be in the man1 subdirectory

mkdir -p /tmp/man/man1        # /tmp/man is the MANPATH component
cp ranger.1 /tmp/man/man1/    # Put ranger.1 into the man1 subdirectory

MANPATH=/tmp/manman ranger    # Override the MANPATH for the example

You could try ln -s . man1, which creates a man1 "subdirectory" that is actually the same as your current directory (doc), and then your example should work:

MANPATH=/path/to/doc man ranger

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.