删除X天后的文件


13

我想删除比2 JUN 22:27更新的文件,更具体地说是/ usr / include的符号链接。

我怎样才能做到这一点?

Answers:


24

您可能要使用find -newermt

确保先检查要删除的文件:

find /usr/include -type l -newermt "Jun 2 22:27"

使用-delete来进行实际的排除。

find /usr/include -type l -newermt "Jun 2 22:27" -delete

1
额外的信息,从当前目录中删除普通文件,例如:find . -newermt "Aug 3 5:27" -delete
HarkályGergő
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.