我想知道“man 3 command”与“man command”有什么区别?
我在 wiki ( http://en.wikipedia.org/wiki/Man_page ) 中读到man 3 在手册页的第 3 部分中用于 Linux。第 3 节涉及库函数,特别是 C 标准库。
我尝试了“man 3 ls”并得到了这个:
No entry for ls in section 3 of the manual
Run Code Online (Sandbox Code Playgroud)
我想知道什么时候用 man 3 什么时候用 man ,它们是否有不同的用途?
谢谢。
Kei*_*son 13
man 3 ls只会向您显示ls手册第 3 部分中的手册页。第 3 节介绍库函数;因为(可能)没有名为 的库函数ls,所以它找不到任何东西。
man没有节号的命令以我不记得的预定义顺序搜索节,但它可能接近于从 1 开始的数字顺序。因此man ls将ls在第 1 节中找到手册页,其中涵盖了用户命令。
这些部分(在我的 Ubuntu 系统上)是:
1 Executable programs or shell commands
2 System calls (functions provided by the kernel)
3 Library calls (functions within program libraries)
4 Special files (usually found in /dev)
5 File formats and conventions eg /etc/passwd
6 Games
7 Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7)
8 System administration commands (usually only for root)
9 Kernel routines [Non standard]
Run Code Online (Sandbox Code Playgroud)
指定部分对于存在于多个部分中的同名内容非常有用。例如,man printf将向您展示printf第 1 部分中用户命令的手册页;要查看该printf函数的手册页,请使用man 3 printf. 您会经常看到这些手册页分别称为printf(1)和printf(3)。
窃取从借用abernert的回答,它经常可以看到这对一个系统调用(第2部分)或库调用(第3节)具有相同名称的包装的用户命令(第1部分); chown并且chmod是很好的例子。
小智 2
有些页面存在于 man 的不同条目中。然后,要访问特定的部分,您可能经常需要使用您希望查看的部分。例如参见whatis find. 您将被引用到三个不同的页面。尝试使用它在括号中输出的每个部分 id。
| 归档时间: |
|
| 查看次数: |
3064 次 |
| 最近记录: |