user124942
user124942

Reputation: 145

Is it possible to change extensions to all files in one folder in Ubuntu?

I want to change extensions from mp3 to mp4 to all files in one directory (folder). Is it possible or I need to write a script to do that?

Upvotes: 0

Views: 66

Answers (1)

Nakor
Nakor

Reputation: 1514

You could imagine something like this:

for f in *.mp3; do
    mv $f ${f/.mp3/.mp4}
done

The part with ${x/a/b} is a string substitution in bash, it replaces a for b in x

Upvotes: 1

Related Questions