如何读取不在 manpath 上的 .man 文件?

发布于 2024-12-19 02:14:44 字数 77 浏览 1 评论 0原文

如何读取不在我的 manpath 上的 .man 文件?我知道我有一个命令,但现在我不记得了,而且我在 man 的手册页中找不到正确的开关。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

怀中猫帐中妖 2024-12-26 02:14:44

您可以尝试通过执行

man path_to_file

以下操作来读取文件,如果 man 在其中找到斜杠 / ,则会将给定参数视为文件。
例如,

man ./my_test

将打开 my_test 文件,同时

man my_test

将在标准手册中查找给定的命令。

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.

清眉祭 2024-12-26 02:14:44

如果您的手册页位于非标准目录位置,您可以使用:

man -M <path to man directory> mymanpage

您还可以使用 MANPATH 环境变量:

MANPATH=<path to man directory> man mymanpage

如果您要格式化独立的手册页,请使用 nroff:

nroff -man mymanpage.1 | less # or your favorite pager

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 | less # or your favorite pager
眼藏柔 2024-12-26 02:14:44

选项 -l, --local-file,如 man man 中所述

man -l ./doc/mypage.1

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

man -l ./doc/mypage.1
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文