2013-06-24 66 views

回答

4

whatis頭朝下它是使用命令makewhatis生成的數據庫,從得到所有的信息。

有兩種方法可以將條目添加到數據庫中。

  1. 創建並安裝程序或腳本的手冊頁,然後運行makewhatis
  2. 編輯whatis數據庫手動。(不建議)

makewhatis拾取從你的命令的手冊頁的NAME節的第一道防線。

的位置在我的機器上whatis數據庫/usr/share/man/whatis,這裏是它的樣子..

ABORT(7)     - abort the current transaction 
ALTER_AGGREGATE(7)  - change the definition of an aggregate function 
ALTER_COLLATION(7)  - change the definition of a collation 
ALTER_CONVERSION(7)  - change the definition of a conversion 
... 
ping(8)     - send ICMP ECHO_REQUEST packets to network hosts 
... 

而這裏的man ping

NAME 
    ping -- send ICMP ECHO_REQUEST packets to network hosts 

SYNOPSIS 
    ping [-AaCDdfnoQqRrv] [-b boundif] [-c count] [-G sweepmaxsize] 
+0

謝謝。我認爲這將是shell腳本本身的一部分。 – KeepCalmAndCarryOn