find -daystart 参数解释
所以我理解这样一行:
find /var/log/ -mtime +60 -type f -exec ls -l {} \;
将列出 /var/log 中 60 天或更早修改的所有文件。
阅读 find 手册页后,我注意到:
Measure times (for -amin, -atime, -cmin, -ctime, -mmin, and
-mtime) from the beginning of today rather than from 24 hours
ago. This option only affects tests which appear later on the
command line.
有人可以解释其余的内容吗? (-amin、-atime、-cmin、-ctime、-mmin)手册页本身似乎并没有真正声明它们各自的作用?
一些可能帮助我理解的示例问题:
- 查找一小时或更长时间前修改的文件?
- 查找 60 分钟到 10 分钟前修改的文件?
- 查找 2 周前修改的文件?
- 查找最近 5 分钟内创建的文件?
So I understand that a line such as:
find /var/log/ -mtime +60 -type f -exec ls -l {} \;
Will list all files in /var/log which were modified 60 days or more ago.
After reading through the find man page though I noticed:
Measure times (for -amin, -atime, -cmin, -ctime, -mmin, and
-mtime) from the beginning of today rather than from 24 hours
ago. This option only affects tests which appear later on the
command line.
Can someone explain the rest? (-amin, -atime, -cmin, -ctime, -mmin) The man page itself does not seem to really declare what each of these do?
Some example questions which might help me understand:
- Find files modified an hour or more ago?
- Find files modified between 60 minutes and 10 minutes ago?
- Find files modified 2 weeks ago?
- Find files created in the last 5 minutes?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
做不到。 POSIX 没有创建时间的规范。
这些选项在
find(1)
手册页的 EXPRESSIONS 部分的 TESTS 小节中进行了解释。Can't be done. POSIX has no specification for creation time.
These options are explained in the TESTS subsection of the EXPRESSIONS section of the
find(1)
man page.