指令介紹
指令:whereis 隻能用于查找二進制檔案、源代碼檔案和man手冊頁
用法:whereis [options] file whereis 選項 檔案
指令選項
[root@fp-21 ~]# whereis --help
-b # 隻搜尋二進制檔案
-B <dirs> # 隻在設定的目錄下查找二進制檔案
-m # 隻搜尋說明檔案
-M <dirs> # 隻在設定的目錄下查找說明檔案
-s # 隻搜尋原始檔案
-S <dirs> # 隻在設定的目錄下查找原始檔案
-u # 查找不包含指定類型的檔案
-l # 輸入有效的查找路徑
指令執行個體
# 查詢指令“ls”的位置(包含二進制檔案和說明檔案)
[[email protected]-21 ~]# whereis ls
ls: /usr/bin/ls /usr/share/man/man1/ls.1.gz
# 隻在設定的目錄下查找二進制檔案
[[email protected]-21 ~]# whereis -b ls
ls: /usr/bin/ls
# 隻在設定的目錄下查找說明檔案
[[email protected]-21 ~]# whereis -m ls
ls: /usr/share/man/man1/ls.1.gz
link 檢視 Linux 基礎指令