[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: changing extensions, a little OT perhaps.



On Fri, 2002-04-26 at 18:32, Bob Torres wrote:
> Hi All,
> 
> I recently transferred some MP3s from my MacOS desktop to my Debianppc
> laptop.  There are no file extensions for these mp3 files, so they're
> kind worthless for xmms in Linux. 
> 
> On the Linux side, how would I go about adding extensions to these files
> without doing it manually?  In other words, is there something I could
> pass at the command line to accomplish this for a whole directory of
> files?  I've been using Linux for three years or so now, and I've always
> wanted to know how to do this...anyone care to educate me?  I'm hoping
> for something a little more substantive than "go learn sed (or whatever
> program)," though learning by example usually works the best for me. ; )

for i in * ; do mv $i $i.mp3 ; done

Or:

for i in `find -type f | grep -v "\.mp3$"` ; do mv $i $i.mp3 ; done

Untested, but should work... I think.

Cheers

-- 
/Bastien Nocera
http://hadess.net

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: