我尝试了文章中的所有建议:5个天后删除文件的脚本
当我在没有-mtime参数的情况下运行find时,它会找到我要查找的文件。当我添加-mtime +2时,不会返回任何内容。我知道在我使用find命令查找的目录中有适当日期的文件(S)。
发布于 2019-10-10 21:16:24
来自man find:
-atime n
File was last accessed 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.
-mtime n
File's data was last modified n*24 hours ago. See the comments for -atime to
understand how rounding affects the interpretation of file modification times.但也见:
-daystart
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.总之,使用find -mtime +1查找2天前的文件。
https://askubuntu.com/questions/1180098
复制相似问题