這篇文章將為大家詳細講解有關如何在Linux中使用whatis命令,文章內容質量較高,因此小編分享給大家做個參考,希望大家閱讀完這篇文章后對相關知識有一定的了解。
01. 命令概述
whatis命令在一些特定的包含系統命令的簡短描述的數據庫文件里查找關鍵字,然后把結果送到標準輸出。 查找的內容必須完全匹配關鍵字的才會輸出。whatis數據庫文件是用/usr/sbin/makewhatis 命令建立的。
02. 命令格式
whatis [OPTION…] 關鍵詞…
03. 常用選項
Usage: whatis [OPTION...] 關鍵詞... -d, --debug 輸出調試信息 -v, --verbose 輸出詳細的警告信息 -r, --regex 把每個關鍵詞都當作正則表達式解讀 -w, --wildcard 關鍵詞里包含通配符 -l, --long 不要把輸出按終端寬度截斷 -C, --config-file=文件 使用該用戶設置文件 -L, --locale=區域 定義本次搜索所使用的區域設置 -m, --systems=系統 use manual pages from other systems -M, --manpath=路徑 設置搜索手冊頁的路徑為“路徑” -s, --sections=列表, --section=列表 search only these sections (colon-separated) -?, --help give this help list --usage give a short usage message -V, --version print program version
04. 參考示例
[deng@localhost ~]$ whatis ls ls (1) - 列目錄內容 ls (1p) - list directory contents [deng@localhost ~]$ whatis cp cp (1) - 復制文件和目錄 cp (1p) - copy files [deng@localhost ~]$ whatis chown chown (1) - 修改文件所有者和組別 chown (1p) - change the file ownership chown (2) - change ownership of a file chown (3p) - change owner and group of a file [deng@localhost ~]$ whatis man man (1) - 格式化并顯示在線幫助手冊頁 man (7) - 格式化手冊頁的宏 man (1p) - display system documentation [deng@localhost ~]$
如果需要重建這個命令相關信息的數據庫,執行以下命令:
[root@localhost ~]# makewhatis
關于如何在Linux中使用whatis命令就分享到這里了,希望以上內容可以對大家有一定的幫助,可以學到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。