LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 11-12-2006, 04:51 AM   #1
angel115
Member
 
Registered: Jul 2005
Location: France / Ireland
Distribution: Debian mainly, and Ubuntu
Posts: 542

Rep: Reputation: 79
Convert character case command.


Hi there,

I'm looking for a command to covert the character case. I think there is a command who do this kind of thing but i can't remumber it name.

Issue:
I have many files with some uper case character in it (which i don't want)

EX:
Code:
myfiLe.TXT
OneOtherFile.ExtEntIon
And i want them to be like as follow:
Code:
myfile.txt
oneotherfile.extention

Kind regards,
Angel.

Last edited by angel115; 11-12-2006 at 04:53 AM.
 
Old 11-12-2006, 05:07 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

There are more ways of doing this, here are 2:

awk '{ print tolower($0)}' infile

or

tr '[A-Z]' '[a-z]' < infile

Hope this helps.
 
Old 11-12-2006, 05:09 AM   #3
angel115
Member
 
Registered: Jul 2005
Location: France / Ireland
Distribution: Debian mainly, and Ubuntu
Posts: 542

Original Poster
Rep: Reputation: 79
Thumbs up

Thanks.

That's exactly what i was looking for.

Angel.
 
Old 11-12-2006, 05:11 AM   #4
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
Straight from the rename man page:

Quote:
To translate uppercase names to lower, you’d use

rename ’y/A-Z/a-z/’ *
 
Old 12-28-2006, 01:49 PM   #5
angel115
Member
 
Registered: Jul 2005
Location: France / Ireland
Distribution: Debian mainly, and Ubuntu
Posts: 542

Original Poster
Rep: Reputation: 79
Thumbs up

Quote:
Originally Posted by David the H.
Straight from the rename man page:
Even better, thanks alot. (i didn't know this command before)

Angel.

Last edited by angel115; 01-05-2007 at 10:04 AM.
 
  


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
ls only files starting with upper case character sancho1980 Linux - Newbie 19 12-29-2019 10:24 AM
convert a character in a box to keycode number Linh Programming 3 10-14-2003 04:14 PM
Can 't convert from a character to octal value in memory Linh Programming 2 07-21-2003 03:11 PM
Using sed to convert a string to a character? whansard Linux - General 2 01-10-2003 05:13 AM
convert filenames case griv Linux - General 6 01-17-2002 11:10 PM

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

All times are GMT -5. The time now is 08:38 PM.

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