Tuesday, May 7, 2024
20
rated 0 times [  20] [ 0]  / answers: 1 / hits: 2281  / 1 Year ago, sat, may 13, 2023, 1:00:21

I have a bunch of wav files I converted to mp3 files using ffmpeg.


Now the mp3 files are all named file.wav.mp3.


How can I remove the .wav suffix while keeping the rest of the file name?
I would like to do this on a whole directory at once.


More From » command-line

 Answers
6

With a shell loop, removing the shortest "double dot suffix"


for f in *.wav.mp3; do echo mv "$f" "${f%.*.*}.mp3"; done

or (my personal favorite for things like this) with mmv from package mmv


mmv -n '*.wav.mp3' '#1.mp3'

Remove the echo or the -n as appropriate once you are happy that they are doing the right thing.


[#2935] Saturday, May 13, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tresein

Total Points: 197
Total Questions: 113
Total Answers: 112

Location: Hungary
Member since Wed, Nov 9, 2022
2 Years ago
tresein questions
;