find 可在指定目錄下依名稱、時間、大小、擁有者等條件搜尋檔案。
find dir -name filename command
find . -name hello -print find . -ctime +7 -print find . -size +2000m -print find /tmp -user b1234567 -print find . -name test* -print
若要刪除符合條件的檔案,可搭配 -exec:
find . -name '*.c' -exec rm {} ;
find 的強項在於能組合多種條件,對批次維護與清理相當實用。