Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

rzacharia

macrumors newbie
Original poster
Jun 5, 2004
15
0
I guess when I replaced my hard drive a lot of my music files got duplicated when I restored the files. Now what exists is an iTunes music folder with probably 1500 duplicated files dispersed throughout the various subfolders that iTunes creates. However, iTunes doesn't list any of the duplicates.

I want to know how to automate the deletion of the duplicate files without affecting any of files that my iTunes music library links to (because I have a lot of ratings, play counts, etc.). The difficulty is that there is no specific date for when the duplicates were made so it is difficult to locate which can be deleted and which, because they are in the iTunes library, should not be deleted.

Thanks!
 
stoid said:
iTunes has a find duplicates function. Have you tried that?

The iTunes library does not include the duplcated songs. Only the iTunes music folder does. Even if the files were included in the iTunes library (and thus showed up in iTunes), what would be an easy way to delete the duplicates, since the "show duplicates" function simply lists the songs that are duplicated one on top of another. I would have to select every other song in a list of 2500 songs to get rid of them.
 
rzacharia said:
I guess when I replaced my hard drive a lot of my music files got duplicated when I restored the files. Now what exists is an iTunes music folder with probably 1500 duplicated files dispersed throughout the various subfolders that iTunes creates. However, iTunes doesn't list any of the duplicates.

I want to know how to automate the deletion of the duplicate files without affecting any of files that my iTunes music library links to (because I have a lot of ratings, play counts, etc.). The difficulty is that there is no specific date for when the duplicates were made so it is difficult to locate which can be deleted and which, because they are in the iTunes library, should not be deleted.

Thanks!
I've been looking for a good freeware app to do this. DuplicateHunter appears that it will do this, but it's not free. All the other ones out there (DupeNuke, Mr Clean, etc) leave me a bit nervous. You could try iSweep, though I've never used it so I can't say if/how it would work. Good luck
 
Off the top of my head...

cd ~/iTunes
find . -type f > tmpfull.lst
for file in `cat tmpfull.lst`; do basename $file >> tmpshort.lst; done
cat tmpshort.lst | sort | uniq

Now for any duplicates you can find them in tmpfull.lst and remove them.
 
Mitthrawnuruodo said:
If you have enough HD space, then the best thing you can do is move and consolidate your library, like this article from Apple explains, then you should be able to delete the old music folder (and use the instructions above to move the new one back, if you want to).

This did exactly what I needed it to. It copied just the files that were in my iTunes library (and there were no duplicates there) to a new folder. Then I deleted the old "iTunes Music" folder and replaced it with the new folder I had created.

Thanks so much Mitthrawnuruodo! :D
 
Yeah i should have known this, but if i deselect "Keep iTunes Music folder organized", will my music be saved in 1 folder rather than thousands of subfolders as now? And if this is the case will iTunes and my iPod remember my albums and everything else as now?

I have huge libraries of sound effects that i use for projects which i browse through iTunes, and I hate having to bring up itunes all the time and the having to choose 'Show Song File' to find a particular clip!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.