例如查
wait
这个命令,
[root@jcwkyl /]# man -k wait
部分输出如下:
wait (1p) - await process completion
wait (2) - wait for process to change state
wait (3p) - wait for a child process to stop or terminate
wait3 [wait4] (2) - wait for process to change state, BSD style
wait4 (2) - wait for process to change state, BSD style
wait [builtins ] (1) - bash built-in commands, see bash(1)
waitid (3p) - wait for a child process to change state
waitpid [wait] (2) - wait for process to change state
waitpid [wait] (3p) - wait for a child process to stop or terminate
上述命令 man –k 等同于 apropos 命令。会看到输出的第行分三部分,最中间的部分就表示这个命令在哪一类。例如:
wait (2) - wait for process to change state
就表示这个一个系统调用。因为分类 2 是系统调用的分类。
man 文档分为 9 大类 ( 来自 http://tldp.org/HOWTO/Man-Page/q2.html ) :
了解这些,在看一个命令的
man
文档的
see also
部分时就能猜到这个命令大概是哪一类的,是一个
bash
命令,还是一个系统调用,还是其它,等等,心里会有个数。
http://man.linuxmanpages.com/ 这是 man 的在线文档,它将 man 文档分为 8 个大类,并且可以方便地点击分类的链接来查看这个分类下面有哪些命令。
曾经自己在 linux 下写一个 socket 程序,因为记不太清楚 sockaddr_in 数据结构的定义,但是又 man 不到,最后在 linuxforum 论坛上找到了答案:应该用 man 7 ip 来看。
[root@jcwkyl /]# man -k wait
部分输出如下:
wait (1p) - await process completion
wait (2) - wait for process to change state
wait (3p) - wait for a child process to stop or terminate
wait3 [wait4] (2) - wait for process to change state, BSD style
wait4 (2) - wait for process to change state, BSD style
wait [builtins ] (1) - bash built-in commands, see bash(1)
waitid (3p) - wait for a child process to change state
waitpid [wait] (2) - wait for process to change state
waitpid [wait] (3p) - wait for a child process to stop or terminate
上述命令 man –k 等同于 apropos 命令。会看到输出的第行分三部分,最中间的部分就表示这个命令在哪一类。例如:
wait (2) - wait for process to change state
就表示这个一个系统调用。因为分类 2 是系统调用的分类。
man 文档分为 9 大类 ( 来自 http://tldp.org/HOWTO/Man-Page/q2.html ) :
Section The human readable name 1 User commands that may be started by everyone. 2 System calls, that is, functions provided by the kernel. 3 Subroutines, that is, library functions. 4 Devices, that is, special files in the /dev directory. 5 File format descriptions, e.g. /etc/passwd . 6 Games, self-explanatory. 7 Miscellaneous, e.g. macro packages, conventions. 8 System administration tools that only root can execute. 9 Another (Linux specific) place for kernel routine documentation. n (Deprecated) New documentation, that may be moved to a more appropriate section. o (Deprecated) Old documentation, that may be kept for a grace period. l (Deprecated) Local documentation referring to this particular system. |
http://man.linuxmanpages.com/ 这是 man 的在线文档,它将 man 文档分为 8 个大类,并且可以方便地点击分类的链接来查看这个分类下面有哪些命令。
曾经自己在 linux 下写一个 socket 程序,因为记不太清楚 sockaddr_in 数据结构的定义,但是又 man 不到,最后在 linuxforum 论坛上找到了答案:应该用 man 7 ip 来看。