查找不到一周前创建的目录

Ser*_*gey 5 unix bash find

我知道我可以使用此命令查找不到一周前创建或修改的目录:

find /home -type d -mtime -7
Run Code Online (Sandbox Code Playgroud)

但是如何查找不到一周前创建的目录?

Sla*_*Nov 7

存储创建时间.

您只能检查3个时间戳

Last access time
Last modification time
Last change time
Run Code Online (Sandbox Code Playgroud)

"更改"是以下之一:权限更改,重命名等.虽然修改仅是内容.


wil*_*ser 5

简短的回答:你做不到.

有三次存储在inode中

  • ctime:创建或更改inode的时间
  • mtime:inode引用的文件的最后一次更改时间
  • atime:上次访问文件的时间

重点是:ctime不仅可以通过create更改,还可以通过chmod/chown进行更改,甚至可以通过ln(不确定)进行更改.Man stat并且man touch是你的朋友.

如果您尝试通过find /home -type d -mtime -7准备找到其模式或所有者已更改的旧目录来查找新目录.