如何在Linux中获取C函数的手册页而不是bash命令的手册?

Geo*_*rge 22 c linux manpage

如何在Linux中获取C函数的手册页而不是shell命令手册?

例如,当我输入时,man bind我获取shell命令绑定的man而不是插件绑定C函数的man.

Joe*_*Joe 32

man 2 bind
Run Code Online (Sandbox Code Playgroud)

您只需要另一本手册中的页面!:-) 看到这里

顺便提一下,bind是系统调用,而不是C库函数.系统调用(内核调用)在本手册的第2部分,库函数在第3节中.man man将告诉您如何使用man命令!

  • 值得澄清的是,系统调用位于(2)部分,库函数位于(3)部分.即`man 3 printf` for printf(). (4认同)

dev*_*ull 26

man man会告诉你:

SYNOPSIS
   man ... [[section] page ...] ...
Run Code Online (Sandbox Code Playgroud)
   The table below shows the section numbers of the manual followed 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  conventions), e.g.
       man(7), groff(7)
   8   System administration commands (usually only for root)
   9   Kernel routines [Non standard]
Run Code Online (Sandbox Code Playgroud)

例如,man 1 printf将显示printfshell实用程序man 3 printf的手册,同时将显示printf()libc中的手册.

(如果有疑问,请说man -k foobar.它将提供一个手册页列表foobar作为正则表达式.)

  • 有趣的。对我来说,“man 3 printf”返回“第 3 节中没有 printf 的手动输入” (2认同)