Script to add extension to filename

Hi all,

I have a folder with a bunch of files in them, and I would like to add an extension (.mp3)to all these filenames. The folder has only files that I'd like .mp3 added to.

It looks something like this:

Intput:

File1
File2
File3

Output:

File1.mp3
File2.mp3
File3.mp3

Thanks in advance!

find ./folder -type f -exec mv '{}' '{}.mp3' ';'
1 Like

Hi,
you can try

for i in File*
do
mv $i $i.mp3
done
1 Like