Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 07-20-2005, 05:38 AM   #1
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, 05:58 AM   #2
Registered: Feb 2005
Posts: 36

Rep: Reputation: 15

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

should work
Old 07-20-2005, 06:03 AM   #3
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, 06:19 AM   #4
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 :

Have fun
Old 07-20-2005, 06:27 AM   #5
Registered: Jun 2005
Posts: 167

Rep: Reputation: 30
Just type,

rename .WAV .wav *.WAV


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

All times are GMT -5. The time now is 12:13 PM.

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