代码之家  ›  专栏  ›  技术社区  ›  Pras

到达正确的手册页

  •  0
  • Pras  · 技术社区  · 8 年前

    当我在shell提示符下输入'man read'时,它会显示read shell命令,如何打开read()c函数的文档。 我的问题不仅仅是read适用于类似的其他函数,比如sleep()

    我通常跑去 https://linux.die.net 当它发生并引用那里的文档时,我确信有办法从shell提示符本身转到正确的手册页

    1 回复  |  直到 8 年前
        1
  •  2
  •   chuckx    8 年前
    man <section #> <page>
    

    从手册页:

       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]
    

    要查找给定页的哪些节,可以使用 -k 旗帜:

    $ man -k ^sleep$
    sleep (1)            - delay for a specified amount of time
    sleep (3)            - sleep for a specified number of seconds