如何查找特定命令的可用手册章节/部分?

如何查找特定命令的可用手册章节/部分?

例如:ls命令只有第 1 章。而建立目录命令有第 1 章和第 2 章。是否有任何命令可以显示特定命令有多少个可用章节?

[root@localhost /]# man 1 ls
[root@localhost /]# man 2 ls
No entry for ls in section 2 of the manual
[root@localhost /]# man 3 ls
No entry for ls in section 3 of the manual
[root@localhost /]# man 4 ls
No entry for ls in section 4 of the manual
[root@localhost /]# man 5 ls
No entry for ls in section 5 of the manual
[root@localhost /]# man 6 ls
No entry for ls in section 6 of the manual
[root@localhost /]# man 7 ls
No entry for ls in section 7 of the manual
[root@localhost /]# man 8 ls
No entry for ls in section 8 of the manual

[root@localhost /]# man 1 mkdir
[root@localhost /]# man 2 mkdir
[root@localhost /]# man 3 mkdir
No entry for mkdir in section 3 of the manual
[root@localhost /]# man 4 mkdir
No entry for mkdir in section 4 of the manual
[root@localhost /]# man 5 mkdir
No entry for mkdir in section 5 of the manual
[root@localhost /]# man 6 mkdir
No entry for mkdir in section 6 of the manual
[root@localhost /]# man 7 mkdir
No entry for mkdir in section 7 of the manual
[root@localhost /]# man 8 mkdir
No entry for mkdir in section 8 of the manual

答案1

你使用apropos -e ls- 这是精确匹配,并过滤掉很多僵硬的顺便提一下命令将在手册页标题中搜索字符串。我认为相关条目旁边的数字是章节数 - 例如,当我运行apropos -e mkdir

mkdir (1)            - make directories
mkdir (2)            - create a directory

apropos -e ls虽然节目的输出

dircolors (1)        - color setup for ls
ls (1)               - list directory contents

我承认我无法弄清楚命令名称旁边括号中的数字是否是章节编号,但这将是要使用的命令。

相关内容