Thursday, July 30, 2009

Unix file extention rename?

I came across something that is totally stumping me. I have a folder with a bunch of music files that (for instance) are named "track1.wav.mp3". I want to remove the "wav" extention and make them all "track.mp3's" I used what I thought would be the correct command %26lt;cp *.wav.mp3 *.mp3%26gt; but doesnt work. I can't think of how to do it to preserve the filenames without doing it one-by-one. What's the proper flags and syntax?


Guess I am a Unix newbie...





-Zach

Unix file extention rename?
cd to your directory, then type:





ls *.wav* | awk '{print "mv "$0" "$0" "}' | sed s/.wav//2 | sh





enjoy!


No comments:

Post a Comment