linux中man文檔的分類

來源:互聯網
上載者:User

 

例如查
wait
這個命令,

[root@jcwkyl
/]# man
-k wait

部分輸出如下:

wait

                
(1p) 
- await process completion

wait

                
(2) 
- wait for process to change state

wait

                
(3p) 
- wait for a child process to stop or terminate

wait3 [wait4]        
(2) 
-
wait for process to change state, BSD style

wait4               
(2) 
-
wait for process to change state, BSD style

wait

[builtins
]     
(1) 
- bash built-in commands, see bash(1)

waitid


              
(3p) 
- wait for a child process to change state

waitpid


[wait]      
(2) 
- wait for process to change state

waitpid


[wait]      
(3p) 
- wait for a child process to stop or terminate

上述命令
man –k
等同於
apropos
命令。會看到輸出的第行分三部分,最中間的部分就表示這個命令在哪一類。例如:

wait

                
(2) 
- wait for process to change state

就表示這個一個系統調用。因為分類
2
是系統調用的分類。

man
文檔分為
9
大類
(
來自
http://tldp.org/HOWTO/Man-Page/q2.html
)


Section The human readable name

  
1   
User commands that may be started by everyone.

  
2   
System calls, that is, functions provided by the kernel.

  
3   
Subroutines, that is, library functions.

  
4   
Devices, that is, special files in the /dev directory.

  
5   
File format descriptions, e.g. /etc/passwd
.

  
6   
Games, self-explanatory.

  
7   
Miscellaneous, e.g. macro packages, conventions.

  
8   
System administration tools that only root can execute.

  
9   
Another (Linux specific) place for kernel routine documentation.

  
n
   
(Deprecated) New documentation, that may be moved to a more appropriate section.

  
o
   
(Deprecated) Old documentation, that may be kept for a grace period.

  
l
   
(Deprecated) Local documentation referring to this particular system.

瞭解這些,在看一個命令的
man
文檔的
see also
部分時就能猜到這個命令大概是哪一類的,是一個
bash
命令,還是一個系統調用,還是其它,等等,心裡會有個數。

http://man.linuxmanpages.com/

這是
man
的線上文檔,它將
man
文檔分為
8
個大類,並且可以方便地點擊分類的連結來查看這個分類下面有哪些命令。

曾經自己在
linux

下寫一個
socket
程式,因為記不太清楚
sockaddr_in

資料結構的定義,但是又
man
不到,最後在
linuxforum

論壇上找到了答案:應該用
man 7 ip

來看。

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.