whereis 專門搜尋程式相關檔案(二進制、man page、原始碼),速度極快,因查詢預建資料庫(/var/lib/mlocate/mlocate.db),非即時掃描硬碟。
whereis [-bmsu] [-B 路徑] [-M 路徑] [-S 路徑] 檔名
| 參數 | 功能 |
|---|---|
-b | 僅搜尋二進制執行檔 |
-m | 僅搜尋手冊頁 |
-s | 僅搜尋原始碼 |
-u | 搜尋非上述三類檔案 |
-B/-M/-S | 指定對應類型搜尋路徑 |
whereis svn
# svn: /usr/bin/svn /usr/local/svn /usr/share/man/man1/svn.1.gz
whereis -b svn # 僅顯示 /usr/bin/svn /usr/local/svn
whereis -m svn # 僅顯示 /usr/share/man/man1/svn.1.gz
whereis -s svn # 無輸出 (無原始碼)
updatedb),新安裝套件可能暫時查不到,手動執行 updatedb 即可。find 或 locate。