Click to See Complete Forum and Search --> : renaming multiple files


Priemsy
03-30-2001, 04:28 AM
hi everyone,

just wondering how to rename multiple files. I've got a large mp3 collection which all need .mp3 added to their filename. I used to know how to do it but I've forgotten.

Thanks for your help

nopun
03-30-2001, 06:14 AM
Something like

for i in *
do
mv $i ${i}.mp3
done

would chuck a .mp3 extension indiscriminately on everything in the current directory.
A further refinement might be to substitute the following for the *

`ls |grep -v \.mp3$`

demian
03-30-2001, 09:36 AM
mmv '*' '#1'.mp3