I screwed up and accidentally have a bunch of files with the extension .mp3.mp3.mp3.mp3
How can I change these, recursively—and over multiple directories—to set them to just .mp3
?
Answer
There is a fairly simple solution, which is to just cut off everything from the first ".mp3" and then add ".mp3" back on. So:
for file in $(find . -name "*.mp3"); do mv "$file" "${file%%.mp3*}.mp3"; done
No comments:
Post a Comment