LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-13-2006, 09:02 PM   #1
bhert
Member
 
Registered: May 2006
Distribution: OpenSUSE 10.3 Kubuntu Hardy Heron
Posts: 268

Rep: Reputation: 30
file names, switching from upper to lower


Hello, what is the best way to switch a group of file names in a directory from upper to lower case and vice versa? Thanks.

bhert
 
Old 08-13-2006, 09:21 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
The following will translate the lower case characters in a filename to upper case for all of the files in the ls part:
Code:
for z in `ls`; do mv $z `echo $z | tr [:lower:] [:upper:]`; done
 
Old 08-13-2006, 09:39 PM   #3
bhert
Member
 
Registered: May 2006
Distribution: OpenSUSE 10.3 Kubuntu Hardy Heron
Posts: 268

Original Poster
Rep: Reputation: 30
Thanks gilead , I have been trying varities of for loops earlier but couldn't get it right before. Thanks again for your help.

bhert
 
Old 08-13-2006, 09:43 PM   #4
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
No problem - glad to help
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i convert file names to lower case and remove the underscore from the name? asilentmurmur Linux - Newbie 16 10-30-2012 06:52 PM
Mount DVD While Preserve Upper Case File Names xptools Linux - Software 2 12-12-2005 10:18 AM
Upper and lower case problem when mount hardisk UltraSoul Linux - Newbie 1 10-28-2005 08:50 AM
grep [A-Z] & [a-z] match both upper and lower case. jschiwal Linux - General 4 05-28-2005 06:43 AM
Apache and upper or lower case. dsiguy Linux - General 3 02-04-2003 11:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration