nul-point

完全に自分用の備忘録です。

findで特定の日付でファイルを絞る

-newerXYで絞る

# find . -type f -newermt 2013-5-16 -ls
133887   68 -rwxr-xr-x   1 root     root        68616 May 16  2013 ./gzip
140242   52 -rwxr-xr-x   1 root     root        52656 May 16  2013 ./touch
133871   16 -rwxr-xr-x   1 root     root        12304 Sep 17 16:38 ./tracepath6
133894   12 -rwxr-xr-x   1 root     root        11912 Jun 14  2013 ./cgdelete
132237   32 -rwxr-xr-x   1 root     root        28784 May 16  2013 ./nice
134453   16 -rwxr-xr-x   1 root     root        13696 Jun 14  2013 ./lssubsys
133899   64 -rwxr-xr-x   1 root     root        65032 May 16  2013 ./stty
133874   20 -rwxr-xr-x   1 root     root        20176 Jun 14  2013 ./cgsnapshot
132234   60 -rwxr-xr-x   1 root     root        57464 May 16  2013 ./chown
134454   28 -rwxr-xr-x   1 root     root        28176 May 16  2013 ./echo
133893   28 -rwxr-xr-x   1 root     root        25120 May 16  2013 ./true
141296   28 -rwxr-xr-x   1 root     root        26256 May 16  2013 ./link
~

-newerで絞る

絞りたい日時でファイルを作成

touch -t 1401030000 hoge
touch -t 1401050000 fuga
# find . -newer hoge -a ! -newer fuga -ls
153977    0 -rw-r--r--   1 root     root            0 Jan  5 00:00 ./fuga
153805    0 -rw-r--r--   1 root     root            0 Jan  5 00:00 ./file05
153804    0 -rw-r--r--   1 root     root            0 Jan  4 00:00 ./file04