One liner to remove duplicate files from itunes
Find duplicate files and send to duplicates file to review:
$fdupes -r ./stuff > dupes.txt
(ref: Fdupes)
ls | egrep “.*[0-9]+.mp3” dupes.txt | sed “s/’/\\\’/g” | xargs -I {} rm {}
____________________________________________
You can also use awk if the duplicates end in format: [0-9]+.m4a
awk ‘/[0-9]+.m4a$/’ dupes.txt |sed “s/’/\\\’/g” | xargs -I {} rm {}
(Since iTunes rename your directories by Artist/Album/Song so you may have titles with original names that are not in [0-9]+.mp3 format, which you have to remove separately)
iTunes caches your library so if you remove files, it wont rescan it.
1. You need to either update your “iTunes Music Library.xml” file or to remove files from iTunes library (remember to chose “Keep Original Files”) and then reimport folder into Library again
OR
2. Drag updated folders back into iTunes for rescan
Other options w/o Unicode support
Media Monkey (on PC)
Helium Music (on Mac)