Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
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!!)

Replies are listed 'Best First'.
Re^2: search folder and delete certain files with perl
by sundialsvc4 (Abbot) 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?
[ambrus]: YourMother: my brother told me their cat wants to climb into the dishwasher if they leave the door open. Not when the dishwasher is started, but after it's done washing, because it's still warm and cats like warm.

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (14)
As of 2017-12-18 15:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (492 votes). Check out past polls.

    Notices?