2015年5月13日 星期三

[Linux 常見問題] What do the numbers in a man page mean?

Source From Here
Question
So, for example, when I type man ls I see LS(1). But if I type man apachectl I see APACHECTL(8) and if I type man cd I end up with cd(n).

I'm wondering what the significance of the numbers in the parentheses are, if they have any.

Answer
The number corresponds to what section of the manual that page is from; 1 is user commands, while 8 is sysadmin stuff. The man page for man itself (man man) explains it and lists the standard ones (Below is Ubuntu 14 man man page):


There are certain terms that have different pages in different sections (e.g. printf as a command appears in section 1, as a stdlib function appears in section 3); in cases like that you can pass the section number to man before the page name to choose which one you want, or use man -a to show every matching page in a row:
$ man 1 printf # Executable programs or shell commands
$ man 3 printf # Library calls (functions within program libraries)
$ man -a printf

You can tell what sections a term falls in with man -k (equivalent to the apropos command). It will do substring matches too (e.g. it will show sprintf if you run man -k printf), so you need to use ^term to limit it:
# man -k '^printf'
printf (1) - format and print data
printf (3) - formatted output conversion


沒有留言:

張貼留言

[Git 常見問題] error: The following untracked working tree files would be overwritten by merge

  Source From  Here 方案1: // x -----删除忽略文件已经对 git 来说不识别的文件 // d -----删除未被添加到 git 的路径中的文件 // f -----强制运行 #   git clean -d -fx 方案2: 今天在服务器上  gi...