Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Rmtree with exclude

by Arunbear (Prior)
on Dec 01, 2014 at 16:45 UTC ( [id://1108849]=note: print w/replies, xml ) Need Help??


in reply to Rmtree with exclude

rmtree doesn't handle such exclusions, however this task can also be achieved using some standard command line tools e.g.
+4:35% find . -wholename '*/cache/*' ./cache/01 ./cache/01/aa ./cache/02 ./cache/02/aa ./cache/_01 ./cache/_01/aa +4:35% find . -wholename '*/cache/*' ! -wholename '*_*' ./cache/01 ./cache/01/aa ./cache/02 ./cache/02/aa +4:35% find . -wholename '*/cache/*' ! -wholename '*_*' | xargs rm -rf +4:36% find . -wholename '*/cache/*' ./cache/_01 ./cache/_01/aa
See find, xargs

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-04-18 17:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found