例如:man(1)
,find(3)
,updatedb(2)
?
括号中的数字(英国的“方括号”)是什么意思?
例如:man(1)
,find(3)
,updatedb(2)
?
括号中的数字(英国的“方括号”)是什么意思?
Answers:
这是命令的手册页分配到的部分。
这些被拆分为
每个部分的原始说明可以在Unix程序员手册(第ii页)中找到。
man 5 foo
该命令的部分在手册中进行了说明。这些部分的列表记录在手册上。例如:
man 1 man
man 3 find
当不同部分上存在相似或完全相等的命令时,这很有用
正如@Ian G所说,它们是手册页部分。不过,让我们更进一步:
man man
,它显示9个部分,如下所示:DESCRIPTION
man is the system's manual pager. Each page argument given
to man is normally the name of a program, utility or func‐
tion. The manual page associated with each of these argu‐
ments is then found and displayed. 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 sec‐
tions following a pre-defined order ("1 n l 8 3 2 3posix 3pm
3perl 5 4 9 6 7" by default, unless overridden by the SEC‐
TION directive in /etc/manpath.config), and to show only the
first page found, even if page exists in several sections.
The table below shows the section numbers of the manual fol‐
lowed by the types of pages they contain.
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 conven‐
tions), e.g. man(7), groff(7)
8 System administration commands (usually only for root)
9 Kernel routines [Non standard]
A manual page consists of several sections.
man <section_num> <cmd>
假设您正在四处寻找Linux命令。您可以OPEN(2)
在线找到pg:http : //man7.org/linux/man-pages/man2/open.2.html。
要在PC的手册页中看到此内容,只需键入man 2 open
。
对于FOPEN(3)
使用man 3 fopen
等。
man <section_num> intro
要阅读介绍页面到部分,在man <section_num> intro
,如man 1 intro
,man 2 intro
,man 7 intro
等。
要依次查看所有手册页介绍,请执行man -a intro
。将打开第1节的介绍页面。按q退出,然后按Enter查看第8部分的介绍。按q退出,然后按Enter查看第3部分的介绍。继续此过程直到完成。每次点击后q,都会带您回到主终端屏幕,但仍会出现在交互式提示中,并且您会看到以下行:
--Man-- next: intro(8) [ view (return) | skip (Ctrl-D) | quit (Ctrl-C) ]
请注意,man -a intro
引导您完成本节的顺序为:
该搜索顺序是有意的,如man man
页面所示:
The default action is to search in all of the available sections follow‐
ing a pre-defined order ("1 n l 8 3 2 3posix 3pm 3perl 5 4 9 6 7" by default, unless overrid‐
den by the SECTION directive in /etc/manpath.config)
维基百科有关手册部分的详细信息: