如何使用“查找”来搜索特定日期创建的文件? [英] How to use 'find' to search for files created on a specific date?
问题描述
我如何使用UNIX命令找到
来搜索特定日期创建的文件?
How do I use the UNIX command find
to search for files created on a specific date?
推荐答案
正如马克斯指出的那样,你不能,但检查修改或访问的文件是不是所有的努力。我写了一个<一个href=\"http://virtuelvis.com/2008/10/how-to-use-find-to-search-for-files-created-on-a-specific-date/\">tutorial这一点,迟至今日。其实质是利用 -newerXY
和! -newerXY
:
As pointed out by Max, you can't, but checking files modified or accessed is not all that hard. I wrote a tutorial about this, as late as today. The essence of which is to use -newerXY
and ! -newerXY
:
例如:要找到修订于2007年6月7日的所有文件:
Example: To find all files modified on the 7th of June, 2007:
$ find . -type f -newermt 2007-06-07 ! -newermt 2007-06-08
要找到在九月29日访问的所有文件,2008:
To find all files accessed on the 29th of september, 2008:
$ find . -type f -newerat 2008-09-29 ! -newerat 2008-09-30
或者,这对当天他们的许可修改过的文件:
Or, files which had their permission changed on the same day:
$ find . -type f -newerct 2008-09-29 ! -newerct 2008-09-30
如果你没有在文件上更改权限,'C'通常会对应创建日期,但。
If you don't change permissions on the file, 'c' would normally correspond to the creation date, though.
这篇关于如何使用“查找”来搜索特定日期创建的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!