Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: search folder and delete certain files with perl

by Eliya (Vicar)
on Dec 07, 2011 at 21:52 UTC ( #942334=note: print w/ replies, xml ) Need Help??


in reply to search folder and delete certain files with perl

Maybe just use the system tool?

$ find /var/opt/xim/syslogs -maxdepth 1 -type f -name "Syslogd*" -mtim +e +0.5 -delete

(Run without -delete first, to make sure you picked the right files!!)


Comment on Re: search folder and delete certain files with perl
Select or Download Code
Re^2: search folder and delete certain files with perl
by sundialsvc4 (Monsignor) on Dec 08, 2011 at 22:23 UTC

    Yup... what came to my mind right away was find and maybe also xargs.   (Both in a Unix/Linux environment.)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://942334]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2014-08-28 02:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (255 votes), past polls