LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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, 05:51 AM   #1
angel115
Member
 
Registered: Jul 2005
Location: France / Ireland
Distribution: Debian mainly, and Ubuntu
Posts: 535

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 05:53 AM.
 
Old 11-12-2006, 06:07 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390
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, 06:09 AM   #3
angel115
Member
 
Registered: Jul 2005
Location: France / Ireland
Distribution: Debian mainly, and Ubuntu
Posts: 535

Original Poster
Rep: Reputation: 79
Thumbs up

Thanks.

That's exactly what i was looking for.

Angel.
 
Old 11-12-2006, 06:11 AM   #4
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian + kde 4 / 5
Posts: 6,834

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
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, 02:49 PM   #5
angel115
Member
 
Registered: Jul 2005
Location: France / Ireland
Distribution: Debian mainly, and Ubuntu
Posts: 535

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 11:04 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 17 09-29-2016 09:41 AM
convert a character in a box to keycode number Linh Programming 3 10-14-2003 05:14 PM
Can 't convert from a character to octal value in memory Linh Programming 2 07-21-2003 04:11 PM
Using sed to convert a string to a character? whansard Linux - General 2 01-10-2003 06:13 AM
convert filenames case griv Linux - General 6 01-18-2002 12:10 AM

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

All times are GMT -5. The time now is 03:29 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration