Skip to content

Instantly share code, notes, and snippets.

@mdibello
Last active June 27, 2019 02:15
Show Gist options
  • Select an option

  • Save mdibello/5211b2e92ed800130c21b96396192a17 to your computer and use it in GitHub Desktop.

Select an option

Save mdibello/5211b2e92ed800130c21b96396192a17 to your computer and use it in GitHub Desktop.
some commands for batch-converting music files
# wma -> mp3
find . -iname "*.wma" -execdir ffmpeg -i {} {}.mp3 \;
# rename new mp3 files
find . -iname "*.wma.mp3" -execdir rename 's/(.*)\.wma\.mp3/$1.mp3/' {} \;
# delete wma files
find . -iname "*.wma" -execdir rm {} \;
# m4a -> mp3
find . -iname "*.m4a" -execdir ffmpeg -i {} {}.mp3 \;
# rename new mp3 files
find . -iname "*.m4a.mp3" -execdir rename 's/(.*)\.m4a\.mp3/$1.mp3/' {} \;
# delete m4a files
find . -iname "*.m4a" -execdir rm {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment