UNIX find:-newer选项的对面存在?
发布时间:2020-12-15 20:01:32 所属栏目:安全 来源:网络整理
导读:我知道有这个选项为unix的find命令: find -versionGNU find version 4.1 -newer file Compares the modification date of the found file with that of the file given. This matches if someone has modified the found file more recently than file. 有
我知道有这个选项为unix的find命令:
find -version GNU find version 4.1 -newer file Compares the modification date of the found file with that of the file given. This matches if someone has modified the found file more recently than file. 有一个选项,将让我找到比某个文件更旧的文件。我想删除目录中的所有文件以进行清理。所以,一个替代方案,我会发现所有的文件比N天还要做这个工作… 谢谢!
你可以使用!来否定这样的新操作:
find . !! -newer filename 如果你想找到最后修改的文件,然后7天前使用: find . -mtime +7 更新: 要避免与要比较的文件匹配,请使用以下命令: find . !! -newer filename !! -samefile filename (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |