Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Check Directories for Files

by leocharre (Priest)
on Nov 24, 2009 at 20:40 UTC ( #809201=note: print w/ replies, xml ) Need Help??


in reply to Check Directories for Files

Just use bash (I'm sorry, Richard! well, yes, bash or whatnot- but.. the real star here is;) Use gnu findutils

for dir in $(find /rootdir/101/ -type d -name "B??"); do find $dir -type f -exec rm '{}' \; ; done; # or to move elsewhere # do find $dir -type f -exec mv '{}' /tmp/foundstuff/ \; ;
If you know to expect the filesystem hierarchy you suggested- There's not even a need to play with the B?? dirs..
$ find /rootdir/101/ -type f -exec mv '{}' /tmp/foundstuff/ \;


Comment on Re: Check Directories for Files
Select or Download Code
Replies are listed 'Best First'.
Re^2: Check Directories for Files
by drodinthe559 (Monk) on Nov 24, 2009 at 20:55 UTC
    Thank you all for your suggestions.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2015-07-29 01:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (260 votes), past polls