whereis#
whereis 是包含在 util-linux 軟體包的一部分
Install#
$ sudo apt install util-linuxOperate#
與 which 僅搜尋 $PATH 變數不同,whereis 會搜尋系統中一組固定的標準目錄。 這些目錄通常包括:
/bin, /sbin, /usr/bin, /usr/sbin (執行檔)/usr/share/man (說明文件)/usr/src (原始碼)
| operation | description | example |
|---|---|---|
| -b | 只搜尋執行檔 | whereis -b ls |
| -m | 只搜尋說明文件 | whereis -m ls |
| -s | 只搜尋原始碼 | whereis -s ls |
| -u | 顯示未分類的檔案 | whereis -u ls |
-B <path> | 指定搜尋執行檔的目錄 | whereis -B /custom/bin ls |
-M <path> | 指定搜尋說明文件的目錄 | whereis -M /custom/man ls |
-S <path> | 指定搜尋原始碼的目錄 | whereis -S /custom/src ls |
Reference#
Official docs: