August 26, 201114 yr I have certain folders named $esnp that I would like to delete if they are 72 hours old. Can anyone help me with that? Thanks
August 27, 201114 yr This should list matches in the current directory older than 3 days: find . -mtime +2 -name "\$esnp" -print Change -print to -delete if you're absolutely sure. Test, test, test with -print to make certain. Edit: (good gosh, proofread!) To delete multiple directory levels you need to work from the bottom up with the -depth option. This would do that from /var/log on down (from the bottom up): find /var/log -depth -mtime +2 -name "\$esnp" -print Here's the dangerous version. It doesn't need -depth since that's implied with -delete: find /var/log -mtime +2 -name "\$esnp" -delete Anywhere close?
Archived
This topic is now archived and is closed to further replies.