LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-20-2005, 04:38 AM   #1
pujolasdf
Member
 
Registered: Feb 2005
Posts: 70

Rep: Reputation: 15
How can I rename a lot of files with a single command?


I have a lot *.WAV files, I want all them to be *.wav (lowercase)... I have foo.WAV I would doo mv foo.WAV foo.wav and that's it, but what if I have more than one (with a single command) ?
 
Old 07-20-2005, 04:58 AM   #2
rcainc
Member
 
Registered: Feb 2005
Posts: 36

Rep: Reputation: 15
Hi,

for foo in *.WAV ; do mv $foo `echo $foo | sed 's/\(.*\.\)WAV/\1wav/'` ; done

should work
 
Old 07-20-2005, 05:03 AM   #3
pujolasdf
Member
 
Registered: Feb 2005
Posts: 70

Original Poster
Rep: Reputation: 15
Uhm... it says that 'misses a file as an argument'. By the way, how that stuff about advanced commands like sed and so (perl regular expressions?) are called so I can learn more about them?
 
Old 07-20-2005, 05:19 AM   #4
rcainc
Member
 
Registered: Feb 2005
Posts: 36

Rep: Reputation: 15
Sorry ,
this command should work, i just copy/past it

for advanced doc you should try one of the best ressource :

http://www.tldp.org/

Have fun
 
Old 07-20-2005, 05:27 AM   #5
chandru.in
Member
 
Registered: Jun 2005
Posts: 167

Rep: Reputation: 30
Just type,

Code:
rename .WAV .wav *.WAV
 
  


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
Command line: Rename several dist files at the same time ExCIA Linux - Newbie 2 04-28-2005 10:12 AM
rename a group of files to a single extention Lleb_KCir Linux - General 9 02-20-2005 12:40 AM
How do I rename a lot of files at once? suresheva31 Linux - General 5 10-12-2004 02:57 PM
rename files on a command line? CrazyPilot Linux - General 9 06-30-2004 04:10 PM
Command to combine several files as a single file, etc. satimis *BSD 3 06-10-2004 03:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:19 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