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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing the case of file names and directories

Status
Not open for further replies.
Nov 6, 2001
77
US
Hello,

I have a directory structure with many files and directories. I need to change all these directory and file names from lower case to upper without going into each directory.

Thanks
 
Try the following:
Code:
find . -depth | perl -n -e 'next unless /[a-z]/; print; s<([^/]+$)><\U$1>; print' | xargs -n2 mv
Try this without mv first, just to make sure it looks OK for your system:
Code:
find . -depth | perl -n -e 'next unless /[a-z]/; print; s<([^/]+$)><\U$1>; print' | xargs -n2
Cheers, Neil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top