LINUX根据时间范围检索文件
csdn发表于:2023-10-08 22:51:09浏览:1123次
LINUX根据时间范围检索文件
1.查找2023-01-05到2023-01-06号之间的文件,使用如下命令即可:
find log/ -name 'abc.pdf' -newermt '2023-01-05' ! -newermt '2023-01-06'
2.找出 3 天”以前”被改动过的文件 72小时之前
find /var/log/ -mtime +3 -type f -print
找出 3 天內被改动过的文件 (0 ~ 72 小时內)
find /var/log/ -mtime -3 -type f -print
找出前第 3 天被改动过的文件 (72 ~ 96 小时)
find /var/log/ -mtime 3 -type f -print