强悍的命令行 —— man 区域码(section numbers)

来源:互联网 发布:android 数组删除元素 编辑:程序博客网 时间:2024/05/19 10:40
$ man man
  • 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]

如:

$ man 7 ascii

man命令的第二个参数是区域码,用来区分索引词的范围,比如printf,在 C 标准库里面的 printf 跟 bash 当中的 printf 是不同的,前者的查询是man 3 printf,后者是man 1 printf。如果这个区域码省略,就会从1开始搜索,直到找到为止。

  • man 3 printf:C 标准库
  • man 1 printf:bash

一些常用 manpages

  • man 1 intro – 一篇对从未接触过Linux的用户的简明教程。
  • man 2 syscalls – 内核系统请求的列表,按内核版本注释分类,系统编程必备。
  • man 2 select_tut – 关于select()系统请求的教程。
  • man 3 string – 在头文件内的所有函数。
  • man 3 stdio – 关于头文件的使用,标准输入/输出库的说明。
  • man 3 errno – 所有errorno的取值及说明。(C语言内类似其他语言的异常告知机制)
  • man 4 console_codes – Linux的终端控制码及其使用解释。
  • man 4 full – 介绍/dev/full这个总是处于“满”状态的磁盘。(对应/dev/null这个总是空的设备)
  • man 5 proc – 介绍/proc下的文件系统。
  • man 5 filesystems – 各种Linux文件系统。

第7区里面的资料通常最酷:

  • man 7 bootparam – 详细解释内核启动参数。
  • man 7 charsets – 解释各种语言的编码集。(gbk,gb2312等)
  • man 7 glob – 解释glob文件名管理机制的工作过程。
  • man 7 hier – 解释Linux文件系统结构各个部分的作用。
  • man 7 operator – C语言的运算符的列表。
  • man 7 regex – 介绍正则表达式。
  • man 7 suffixes – 常见文件后缀名的列表跟解释。
  • man 7 time – Linux的时钟机制解释。
  • man 7 units – 数值单位及其数值的解释。
  • man 7 utf8 – 描述UTF-8编码。
  • man 7 url – 解释URL、URI、URN等的标准。
0 0