How to read a .man file not on manpath?

UnixManpage

Unix Problem Overview


How do I read a .man file that's not on my manpath? I know I had a command for this, but now I don't remember, and I can't find the right switch in the man pages for man.

Unix Solutions


Solution 1 - Unix

You can try to read your file by doing

man path_to_file

as man will treat the given argument as a file if it finds a slash / in it. For instance

man ./my_test

will open the my_test file, while

man my_test

will look in the standard manual for the given command.

Solution 2 - Unix

If your man page is in a non-standard directory location, you can use:

man -M <path to man directory> mymanpage

You can also use the MANPATH environment variable:

MANPATH=<path to man directory> man mymanpage

If you are looking to format a standalone man page, use nroff:

nroff -man mymanpage.1

Solution 3 - Unix

The option -l, --local-file, as documented in man man

man -l ./doc/mypage.1

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionNagelView Question on Stackoverflow
Solution 1 - UnixmoongoalView Answer on Stackoverflow
Solution 2 - UnixDavid K. HessView Answer on Stackoverflow
Solution 3 - UnixteknopaulView Answer on Stackoverflow