shell - 联机帮助页标题中 shell 命令名称后面的括号中的数字有何含义?

标签 shell manpage

我到处都能看到这些数字。例如,在此页面上:http://linux.die.net/man/1/tar

tar(1) 中的数字 - 1 的含义是什么?我也见过 2、5 等。

最佳答案

它告诉您其联机帮助页属于哪个组,或者更一般地说,该项目本身属于哪个组。以下是各部分及其内容的列表:

   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]

有关更多详细信息,请参阅“man”的联机帮助页。或者看看这里: http://linux.die.net/man/

有时来自不同组的项目可以具有相同的名称,这是区分它们的方法。例如,有一个 printf(1) 的联机帮助页,它是一个可执行文件,可从 shell 调用,还有一个 printf(3) 的联机帮助页,它是一个 C 语言stdio.h 中定义的函数。

使用 bash 中的 man 二进制文件,您可以通过以下方式调用不同的联机帮助页:

man printf       # displays printf(1)
man 1 printf     # displays printf(1)
man 3 prinft     # displays printf(3)
man -a printf    # displays all manpages matching printf

根据系统上安装的联机帮助页,您有时会从不同手册中获取同一项目的页面。例如,Linux 程序员手册中的 printf(3) 可能有 Posix 程序员手册中的 printf(3p) 对应内容。

关于shell - 联机帮助页标题中 shell 命令名称后面的括号中的数字有何含义?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11405225/

相关文章:

linux - 如何将文件从 windows 复制到 linux(跨平台)?

linux - 如何在 Bash 中提取引号之间的字符串

shell - 通过获取 shell 脚本在 Qt Creator 中设置环境变量

unix - 联机帮助页中的 PROGNAME(x) 引用 -- ()s 中的数字是什么意思?

c - 使用 man 列出 C 函数

macos - 手册页命令在 iTerm2 中不可见

linux - linux中的 'see read(2)'是什么意思?

PHP 无法执行 xcodebuild,如何解决?

linux - shell 脚本中的定时陷阱

Linux:仅为当前用户安装的应用程序中的 Man 命令