find <目錄> <條件> <動作>
-name '模式':檔名比對(支援萬用字元)。-type f/d/l...:檔案類型(一般檔/目錄/符號連結)。-size n[c/k]:大小比對。-mtime/-atime/-ctime n:修改/存取/狀態變更時間(天)。-mmin/-amin/-cmin n:分鐘精度。-exec 指令 {} \;:對結果執行指令。範例:find . -name 'my*' -ls、find / -name httpd.conf -print、find /etc -size -2500c -print。
搜尋 /var/lib/locatedb 資料庫,非即時。用前先 updatedb 更新。
範例:locate /etc/sh、locate -i ~/m(忽略大小寫)。
whereis [-b|-m|-s] 指令。whereis grep 同時顯示三者路徑。
回傳第一個找到的路徑。which grep 確認實際執行哪個版本。
type cd → shell 內建。type grep → 外部指令並顯示路徑。type -p grep 等同 which。