Ubuntu手册模糊不清

时间:2012-10-09 05:25:43

标签: ubuntu man

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

5 个答案:

答案 0 :(得分:4)

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

   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

答案 1 :(得分:2)

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

请参阅man man

答案 2 :(得分:1)

man 3 getopt提供c函数信息。
man 1 getoptman getopt提供命令信息的地方。

传统上使用符号“name(section)”来引用页面:例如,ftp(1)。相同的页面名称可能出现在手册的多个部分中,就像系统调用,用户命令或宏程序包的名称一致时一样。

答案 3 :(得分: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 getopt或{{1} }。

答案 4 :(得分:1)

$ man 3 getopt其中3是部分。

$ man man

正如Sections.所述:

本手册通常分为八个编号部分,组织如下(在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