查找命令中ctime 1和ctime +1之间的差异


17

如果我运行以下命令:

find . -name "*.jar" -type f -ctime +1

我没有返回任何结果,但是如果我运行:

find . -name "*.jar" -type f -ctime 1

我得到结果。

Answers:


23

这意味着目录中的所有jar文件的状态更改都在48小时之前。

详细说明

根据find手册页,

-ctime n
    File's status was last changed n*24 hours ago.

还有...

When find figures out how many 24-hour periods ago the file was 
last accessed, any fractional part is ignored, so to match -atime +1, 
a file has to have been accessed at least two days ago.

还有其他地方

+n for greater than n

因此,-ctime +1意味着文件状态必须至少在48小时前更改。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.