在linux下擷取協助

來源:互聯網
上載者:User

標籤:

1.使用man手冊頁

man是一種顯示Unix/Linux線上手冊的命令。可以用來查看命令、函數或檔案的協助手冊,另外它還可以顯示一些gzip壓縮格式的檔案。

讀者在遇到不懂的命令時,可以用man查看這個命令;寫程式時有不會用的函數時,可以用man查看這個函數;有不懂得檔案時,也可以用man查看檔案。一般情況下man手冊頁的資源主要位於/usr/share/man目錄下,使用如下命令顯示。

[[email protected] ~]# ls /usr/share/man

bg  en  hu  man0p  man2x  man4x  man7   man9x      pt     sl

cs  es  id  man1   man3   man5   man7x  mann       pt_BR  sv

da  fi  it  man1p  man3p  man5x  man8   nl         ro     tr

de  fr  ja  man1x  man3x  man6   man8x  overrides  ru     zh_CN

el  hr  ko  man2   man4   man6x  man9   pl         sk     zh_TW

[[email protected] ~]#

通常使用者只要在命令MAN後,輸入想要擷取的命令的名稱(例如ls),MAN就會列出一份完整的說明,其內容包括命令文法、各選項的意義及相關命令等。

 

Linux man命令的使用方法

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 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]

 

 

 

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下擷取協助

聯繫我們

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