標籤:
Linux提供了豐富的協助手冊,當你需要查看某個命令的參數時不必到處上網尋找,只要man一下即可。
Linux的man手冊共有以下幾個章節:
| 代號 |
代表內容 |
| 1 |
使用者在shell中可以操作的指令或可執行檔 |
| 2 |
系統核心可呼叫的函數與工具等 |
| 3 |
一些常用的函數(function)與函數庫(library),大部分是C的函數庫(libc) |
| 4 |
裝置檔案的說明,通常在/dev下的檔案 |
| 5 |
設定檔或者是某些檔案的格式 |
| 6 |
遊戲(games) |
| 7 |
慣例與協定等,例如Linux檔案系統、網路協定、ASCII code等等的說明 |
| 8 |
系統管理員可用的管理指令 |
| 9 |
跟kernel有關的檔案 |
如:man 5 data
1 Executable programs or shell commands2 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/passwd6 Games7 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]
1、Standard commands (標準命令)
2、System calls (系統調用)
3、Library functions (庫函數)
4、Special devices (裝置說明)
5、File formats (檔案格式)
6、Games and toys (遊戲和娛樂)
7、Miscellaneous (雜項)
8、Administrative Commands (管理員命令)
9 其他(Linux特定的), 用來存放核心例行程式的文檔。
n 新文檔, 可能要移到更適合的領域。
o 老文檔, 可能會在一段期限內保留。
l 本地文檔, 與本特定系統有關的。
例如:我們輸入 man ls,它會在最左上方顯示“LS(1)”,在這裡,“LS”表示手冊名稱,而“(1)”表示該手冊位於第一節章,同樣,我們輸入“man ifconfig”它會在最左上方顯示“IFCONFIG(8)”。也可以這樣輸入命令:“man [章節號] 手冊名稱”。
man是按照手冊的章節號的順序進行搜尋的,比如:
man sleep
只會顯示sleep命令的手冊,如果想查看庫函數sleep,就要輸入:
man 3 sleep
Linux man命令的使用方法