Skip to content

Instantly share code, notes, and snippets.

@parastuffs
Created July 14, 2015 18:53
Show Gist options
  • Save parastuffs/1c8f4da5847dda1434db to your computer and use it in GitHub Desktop.
Save parastuffs/1c8f4da5847dda1434db to your computer and use it in GitHub Desktop.
Rename all mp3 files in folder into "Artist - Track title.mp3" base on mp3 tags.
#!/bin/bash
# Rename all mp3 files in folder into "Artist - track title.mp3" base on mp3 tags.
# Requires mp3info
SAVEIFS=$IFS
IFS=$(echo -en "\n\b");
for f in `ls *.mp3`; do
artist=`mp3info -p %a $f`
title=`mp3info -p %t $f`
mv ${f} "${artist} - ${title}.mp3"
done
IFS=$SAVEIFS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment