如何打开不在 man 目录中的手册文件?

How do I open a manual file not located in the man directory?

我想打开一个不在 /usr/share/man/man1 的文件 myscript.1.gz

使用 -l (--local-file) 选项:

man -l myscript.1.gz

来自man man

-l, --local-file

Activate `local' mode. Format and display local manual files instead of searching through the system's manual collection. Each manual page argument will be interpreted as an nroff source file in the correct format. No cat file is produced. If '-' is listed as one of the arguments, input will be taken from stdin. When this option is not used, and man fails to find the page required, before displaying the error message, it attempts to act as if this option was supplied, using the name as a filename and looking for an exact match.