我发现 Ubuntu 手册站点 ( http://manpages.ubuntu.com ) 在我不在装有 Ubuntu 的计算机上时查找联机帮助页非常有用。但是,我发现有时搜索结果表会链接到多个同名联机帮助页。
例如,在每个分布的两个链接中执行此搜索grep结果,都标记为grep(1):一到grep.1posix.html和一到grep.1.html。
我听说 Ubuntu 是“符合 POSIX 标准的”,那么我怎么知道哪个联机帮助页最适用于典型的 Ubuntu 安装呢?(或者,当我使用该man命令时,我如何知道哪个联机帮助页?)
正如man手册页所说:
A section, if provided, will direct man to look only in that section of the manual.
The default action is to search in all of the available sections, following a
pre-defined order and to show only the first page found, even if
page exists in several sections.
Run Code Online (Sandbox Code Playgroud)
在配置文件中,/etc/manpath.config您可以找到实际使用的顺序:
1 n l 8 3 2 3posix 3pm 3perl 5 4 9 6 7
Run Code Online (Sandbox Code Playgroud)
此外,man -a $command将显示所有部分中找到的所有页面,并-S $section-list选项覆盖默认顺序。
最后一点:您可能会发现它man 1posix grep在您的系统上不起作用,因为manpages-posix默认情况下未安装该软件包。