・検索結果を[ls]コマンドで表示
find . -name ‘*.trc’ -ls
・検索結果を[ls -ltr]コマンドで表示
find . -name ‘*.trc’ | xargs ls -ltr
・ファイルに限定
find . -name ‘*.trc’ -type f
・ディレクトリに限定
find . -name ‘*.trc’ -type d
・アクセス日時を指定
find xxxxx -1 | xargs ls -ltr
・任意の日数にアクセスされた対象を指定
find -atime -1 -ls
・任意の日数に更新された対象を指定
find -mtime -1 -ls
・任意の分数にアクセスされた対象を指定
find -amin -1 -ls
・任意の分数に更新された対象を指定
find -mmin -1 -ls
・任意のファイルの更新日時よりも後にアクセスした対象を指定
find -anewer | xargs -ls
・任意のファイルの更新日時よりも後に変更した対象を指定
find -newer -ls
・容量が0のファイル対象を指定
find -empty -ls
・ファイル容量指定
find -size 1024 -ls
・ファイル指定
find -type f
・ディレクトリ指定
find -type d
・パーミッション指定
find -perm 775
・演算子指定
-and
-or
-not
・アクション -exec
find 検索元 検索ファイル名 -exec 実行するコマンド \;
find . -name \*3999\* -exec zip test.zip {} \;
find . -perm 644 -exec chmod 664 {} \;
※参考にしたサイト
エンジニアの入り口
https://eng-entrance.com/linux-command-find