我想限制以下search只有修改date的文件<=“2009-05-29 11:59:00”
find /path -name "*.sb" ! -name "*[^0-9]*.sb" -type f -print
我正在使用CentOS
命令find /path -mtime +7会给你7天以前的文件,并find ! -newer somefile find ! -newer somefile会给你比somefile更旧的文件。 所以…
touch -d "2009-05-29 11:59:00" timestampfile find /path -name "*.sb" ! -name "*[^0-9]*.sb" ! -newer timestampfile -type f -print
! -newermt'2009/5/29 23:59:00'应该在BSD上工作; GNU将会有类似的选项。
find /path \ -type f \ ! -newermt "20090529 1159:00" \ -regex "./[^0-9]*.sb$" \ -print
您可以将regex放在最后以加快命令(将最快的动作放置在开始位置,最慢的位置放在最后)。
你想要更新
find / path -name“ .sb”! -name“ [^ 0-9] *。sb”-type f -print -mdate -2009-05-30
这里有几个例子:
http://www.softpanorama.org/Tools/Find/selecting_files_by_age.shtml
http://www.schuerig.de/michael/linux/snippets.html