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

Re: How do u rename every file in a dir and sub?

by JPaul (Hermit)
on Dec 14, 2001 at 05:34 UTC ( [id://131868]=note: print w/replies, xml ) Need Help??


in reply to How to rename to lowercase every file in a directory and its subdirectories?

One way to do it would be something like this:
#!/usr/bin/perl -w use strict; # Open 'find' process to list files recursively with paths open(FIND, "find |"); while(<FIND>) { chomp; next if $_ eq $0; # Don't rename ourself rename($_, lc($_)); } close(FIND);
It's not remarkably efficient, but it'll do your bidding.

JP

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2024-04-19 10:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found