in reply to How do I delete files based on their timestamp?
This will find all files under /foo/bar that were modified more than 7 days ago and remove them.find /foo/bar -mtime +7 -exec rm -rf {} \;
If you're *nix-impaired :) (and considering that this is a Perl site), use File::Find:
use File::Find; find(\&wanted, '/foo/bar'); sub wanted { unlink $_ if -M $_ > 7; }
|
|---|