in reply to Deleting files
Mark,
You'll need to be a little clearer, since I can't tell if you want to delete files not modified within 5 days or those created more than five days from the present time. I'd guess that you mean modification time, in which case you'll need to look at the -M operator. Something like the following...
unlink map {-M $_ > 5 ? $_ : ()} <c:/foo/*>;
Regards,
welchavw
Update: Please see ysth's explanation below of why this simplistic logic is a non-starter for scripts that run for a long time.
|
|---|