Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Renaming all files recursively (Kind of)

Status
Not open for further replies.

KarveR

MIS
Dec 14, 1999
2,065
GB
Hi all,
Is there an easy way to rename all files in a given directory and recursively inwards.

I have a directory structure that when restored from backup all filenames are in uppercase, all need to be in lowercase.

Thanks for your thoughts. ______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
#!/usr/bin/tclsh

foreach file [glob "dir/target/*"] {
if {[file isfile $file]} {
file rename -force $file [concat [file dirname $file]/[string tolower [file tail $file]]
}
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top