天天看點

Linux常用指令(第二版) --幫助指令幫助指令

1、man[manual]: /usr/bin/man

獲得指令或配置檔案的幫助文檔,優先檢視指令的幫助

格式:man [指令或配置檔案]  #會同時調用more

E.g.

man ls #檢視ls指令的幫助資訊 

man services  #檢視配置檔案services的幫助資訊

附-在Linux系統中幫助檔案分為九種:

如: man 5 passwd //檢視配置檔案的幫助

預設: man 1 passwd

2、info[information]:  /usr/bin/info

說明:與man沒有太大的差別,隻不過是資訊的呈現方式不太一樣,并且在UNIX系統中并沒有這個指令。

3、擷取相關檔案簡短的資訊:

1)whatis[search the whatis database for complete words.]

格式: whatis [任何關鍵字] 

#獲得索引的簡短說明資訊,找到這個指令最基本的用途

如:whatis apropos

2)apropos[search the whatis database for strings.]

格式: apropos [任何關鍵字] 

#用于擷取檔案的配置資訊,類似與:man -k [檔案]

附-但是這兩套指令要能正确執行,必須建立whatis資料庫才行,該指令需要以root身份運作

/usr/sbin/makewhatis

#當使用這兩個指令發生錯誤時,就是whatis資料庫沒有建立

附-[指令] --help #主要用于擷取指令的選項資訊

apropos [檔案]

4、help #檢視Shell内置指令的檔案幫助

如:man cd 與help cd 的不同

附-man bash #可用于檢視Shell含有哪些内置指令

另-關于Shell其他的講解,請參考另外幾篇部落格-《四天精通Shell程式設計》系列:

<a target="_blank" href="http://blog.csdn.net/zjf280441589/article/details/17455515">http://blog.csdn.net/zjf280441589/article/details/17455515</a>

<a target="_blank" href="http://blog.csdn.net/zjf280441589/article/details/17467069">http://blog.csdn.net/zjf280441589/article/details/17467069</a>

<a target="_blank" href="http://blog.csdn.net/zjf280441589/article/details/17487351">http://blog.csdn.net/zjf280441589/article/details/17487351</a>

<a target="_blank" href="http://blog.csdn.net/zjf280441589/article/details/17503985">http://blog.csdn.net/zjf280441589/article/details/17503985</a>