2

我有一个安装了 cygwin 的 Windows 7 盒子。对于给定的文件夹,我如何找到哪些文件的时间戳在某个范围内?我需要对所有文件夹进行递归检查。

4

1 回答 1

1

您可以使用 find 来搜索时间范围,但这是一种解决方法。

创建两个临时文件,例如 temp1、temp2

touch --date 'yyyy-mm-dd' temp1
touch --date 'yyyy-mm-dd' temp2

这会将这些文件的时间戳更改为您设置的任何内容。然后使用 find 和这些文件作为范围:

find /some/dir/ -newer temp1 -not -newer temp2

请注意,您的搜索将返回比 temp1 新但不包括 temp1 的日期和比 temp2 更早的日期。

于 2012-05-29T12:20:48.333 回答