Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: rename subdirectories

by perlfan (Curate)
on Dec 04, 2007 at 19:45 UTC ( #654928=note: print w/ replies, xml ) Need Help??


in reply to rename subdirectories

One of my favorite one-liners does the renaming thing, though I've never tested it it on subdirectories. FWIW:

find . | perl -ne'chomp; next unless -e; $oldname = $_; s/aaa/bbb/; ne +xt if -e; rename $oldname, $_'


Comment on Re: rename subdirectories
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (12)
As of 2015-07-02 09:05 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 (33 votes), past polls