就是指定日期以前的文件,用find命令好像只能查找n天或n分钟以前的文件。
多谢!
4 个解决方案
#1
首先创建一个 test 文件,其时间刚好小于你需要的 2009年3月1日,然后:
貌似就行了!
find ./ -newer test -print
貌似就行了!
#2
find . -newerct "20090301"
#3
刚才看错了
find . ! -newerct "20090301"
find . ! -newerct "20090301"
#4
好像应该是 find . ! -newermt "20090301"
$ man find
......
-newerXY reference
Compares the timestamp of the current file with reference. The
reference argument is normally the name of a file (and one of
its timestamps is used for the comparison) but it may also be a
string describing an absolute time. X and Y are placeholders
for other letters, and these letters select which time belonging
to how reference is used for the comparison.
a The access time of the file reference
B The birth time of the file reference
c The inode status change time of reference
m The modification time of the file reference
t reference is interpreted directly as a time
$ man find
......
-newerXY reference
Compares the timestamp of the current file with reference. The
reference argument is normally the name of a file (and one of
its timestamps is used for the comparison) but it may also be a
string describing an absolute time. X and Y are placeholders
for other letters, and these letters select which time belonging
to how reference is used for the comparison.
a The access time of the file reference
B The birth time of the file reference
c The inode status change time of reference
m The modification time of the file reference
t reference is interpreted directly as a time
#1
首先创建一个 test 文件,其时间刚好小于你需要的 2009年3月1日,然后:
貌似就行了!
find ./ -newer test -print
貌似就行了!
#2
find . -newerct "20090301"
#3
刚才看错了
find . ! -newerct "20090301"
find . ! -newerct "20090301"
#4
好像应该是 find . ! -newermt "20090301"
$ man find
......
-newerXY reference
Compares the timestamp of the current file with reference. The
reference argument is normally the name of a file (and one of
its timestamps is used for the comparison) but it may also be a
string describing an absolute time. X and Y are placeholders
for other letters, and these letters select which time belonging
to how reference is used for the comparison.
a The access time of the file reference
B The birth time of the file reference
c The inode status change time of reference
m The modification time of the file reference
t reference is interpreted directly as a time
$ man find
......
-newerXY reference
Compares the timestamp of the current file with reference. The
reference argument is normally the name of a file (and one of
its timestamps is used for the comparison) but it may also be a
string describing an absolute time. X and Y are placeholders
for other letters, and these letters select which time belonging
to how reference is used for the comparison.
a The access time of the file reference
B The birth time of the file reference
c The inode status change time of reference
m The modification time of the file reference
t reference is interpreted directly as a time