Man page的使用随记

来自三线的随记

description: linux manuals pages 的使用随记以及如何切换manuals pages章节(section)


# man page不同section的意义

       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]

       A manual page consists of several sections.

       Conventional section names include NAME, SYNOPSIS, CONFIGURATION, DESCRIPTION, OPTIONS, EXIT STATUS, RETURN VALUE, ERRORS, ENVIRONMENT, FILES, VERSIONS, CONFORMING TO, NOTES,  BUGS,  EXAM‐

       PLE, AUTHORS, and SEE ALSO.

讲人话

1 标准用户命令(Executable programs or shell commands)
2 系统调用(System calls)functions provided by the kernel
3 库调用(Library call)functions within program libraries
4 特殊文件(设备文件)的访问入口(/dev)Special files (usually found in /dev)
5 文件格式(配置文件的语法),指定程序的运行特性 File formats and conventions
6 游戏(Games)
7 杂项(Miscellaneous)including macro packages and conventions
8
管理命令 System administration commands
9 跟kernel有关的文件 Kernel routines

# 跟section结合使用更佳的命令

whatis

NAME

       whatis - display one-line manual page descriptions

SYNOPSIS

       whatis [-dlv?V] [-r|-w] [-s list] [-m system[,...]] [-M path] [-L locale] [-C file] name ...

## Example

➤ whatis link
link (2)             - make a new name for a file
link (1)             - call the link function to create a link to a file


# 使用man命令的时候切换section的姿势

man 2 link

或使用 -a 参数配合[q] 以及[回车键] 依次阅读所有manual page

man -a link