Linux 技術支援
⇒
基礎篇
進階篇
補腦篇
指令索引
中⇒ENG
版權所有, 引用請註明出處
whereis預設路徑尋找檔案
whereis
為在預設路徑尋找執行檔或 man page 的說明文件或原始碼 。
whereis
命令的語法如下:
whereis [OPTIONS] COMMAND
.
常用的選項有
whereis -b
: 尋找執行檔,搜尋的路徑有 /usr/bin、/usr/sbin、/usr/lib[64]、/etc、/usr/etc、/usr/local、/usr/include、/usr/libexec、/usr/share 等 。
whereis -m
: 尋找 man page 的說明文件,搜尋的路徑有 /usr/share/man 等。
whereis -s
: 尋找原始碼的檔案,搜尋的路徑有 /usr/src 等。
whereis -l
: (小寫的 L)列出搜尋的路徑。
例:
$
whereis -b vi
←搜尋指令〝vi〞所在的目錄
vi: /usr/bin/vi
$
whereis -l | grep 'bin:' | head
←例出搜尋執行檔會找那些目錄
bin: /usr/bin
bin: /usr/sbin
bin: /usr/lib
bin: /etc
以下略
更多
whereis
說明和範例參考
連結
。