2

某些 C 函数的名称与 Ubuntu 命令不明确,例如:getopt。如何查看这些函数的手册页?毫无疑问,它在互联网上很容易获得,但我希望尽可能不要离开航站楼。

4

5 回答 5

4

使用格式man [section] name(例如man 3 getopt),其中section可以是以下之一:

   1      User Commands
   2      System Calls
   3      C Library Functions
   4      Devices and Special Files
   5      File Formats and Conventions
   6      Games et. Al.
   7      Miscellanea
   8      System Administration tools and Deamons

咨询man man了解更多信息。

于 2012-10-09T05:31:39.050 回答
2

man 3 getopt显示 C getopt 的联机帮助页。

man man

于 2012-10-09T05:29:01.520 回答
1

man 3 getopt给出 c 函数信息。
其中 asman 1 getoptman getopt给出命令信息。

页面传统上使用符号“ name(section)”来表示:例如,ftp(1). 相同的页面名称可能出现在手册的多个部分中,例如系统调用、用户命令或宏包的名称重合时。

于 2012-10-09T05:28:17.900 回答
1

man -wa getopt为您提供手册页列表getopt:在我的系统中,它是:

/usr/share/man/man1/getopt.1.bz2
/usr/share/man/man3/getopt.3.bz2
/usr/share/man/man3p/getopt.3p.bz2

或者,或者,man -f getopt

getopt               (1)  - parse command options (enhanced)
getopt               (3)  - Parse command-line options
getopt []            (1)  - parse command options (enhanced)
getopt []            (3)  - Parse command-line options
getopt []            (3p)  - command option parsing

然后,您可以使用文件名中的数字(在第一个输出中)或括号之间的数字(在第二个输出中)选择正确的手册页:例如,man 1 getoptman 3 getopt

于 2012-10-09T05:30:41.647 回答
1

$ man 3 getopt节在哪里3

$ man man

作为部分。状态:

该手册通常分为八个编号的部分,组织如下(在 BSD、Unix 和 Linux 上):

Section     Description
 1.         General commands
 2.         System calls
 3.         Library functions, covering in particular the C standard library
 4.         Special files (usually devices, those found in /dev) and drivers
 5.         File formats and conventions
 6.         Games and screensavers
 7.         Miscellanea
 8.         System administration commands and daemons

Unix System V 使用类似的编号方案,但顺序不同:

Section     Description
 1.         General commands
 1M.        System administration commands and daemons
 2.         System calls
 3.         C library functions
 4.         File formats and conventions
 5.         Miscellanea
 6.         Games and screensavers
 7.         Special files (usually devices, those found in /dev) and drivers
于 2012-10-09T05:31:10.987 回答