Linux man命令的使用方法

來源:互聯網
上載者:User

Linux man命令的使用方法

一:說明

 Linux man命令是初學者必須要掌握的一個Linux重要命令,這個命令可以協助在學習中遇到的各種不會使用的命令問題,每個命令的不同的使用方法都可以在這裡尋找的到。現在介紹具體使用方法。

man就是manual的縮寫,用來查看系統中內建的各種參考手冊,但是手冊頁分為好幾個部分,如下所示:

  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+數字+命令/函數                

         比如:man  2 exit             即可以查到相關的命令和函數

上面什麼意思呢?對應的數字分別如下解釋:

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

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.