トップ   編集 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS

Top / linux / System Command Examples / find examples / find 任意のファイルの更新日時よりも新しいファイルを検索

#author("2018-02-23T14:20:34+09:00","default:kow","kow")
*find 任意のファイルの更新日時よりも更新日時が新しいファイルを検索 [#bca9fc0e]
~
- ''syntax:''
~
&color(red,){'' find 検索Path -newer 元ファイル名 ''};~
~
&color(red,){'' find ./ -newer targetfile ''};~
&color(red,){'' find ./ -newer targetfile -exec mv {} ./backup \; ''};~
~
~
- ''comment:''~
元ファイル名で指定されたファイルの更新日時よりも更新日時が新しいファイルを検索する。~
exec を使用することで、ヒットした物を、個別に処理可能~
~
- ''Example:''
~
#highlight(php:nogutter:collapse){{
#
#date
Fri Feb 23 14:11:25 JST 2018 <---今日は2月23日です。
#ls -l
total 7552
drwx------ 2 root root     512 Feb 23 14:05 backup
-rw------- 1 root root  938584 Feb 19 04:22 secure-20180219
-rw------- 1 root root 2715534 Feb 20 04:32 secure-20180220
-rw------- 1 root root 2924721 Feb 21 04:32 secure-20180221
-rw------- 1 root root  576102 Feb 22 04:22 secure-20180222
-rw------- 1 root root  170236 Feb 23 03:45 secure-20180223
#
#find ./ -newer secure-20180221 <---secure-2018022のFileの更新日時よりも  
                                    新しく更新された物を検索します。
                                    Feb 21 04:32よりも更新日時が新しいもの
./
./backup
./secure-20180223
./secure-20180222
#
}}
~
#highlight(end)
~
~
&tag(Linux,find);
~
~
[[Goto Top Page>/]]
~

Top / linux / System Command Examples / find examples / find 任意のファイルの更新日時よりも新しいファイルを検索