Duplicate File Deletion

Discussion in 'macOS' started by rzacharia, Oct 16, 2005.

  1. rzacharia macrumors newbie

    Jun 5, 2004
    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.

  2. stoid macrumors 601


    Feb 17, 2002
    So long, and thanks for all the fish!
    iTunes has a find duplicates function. Have you tried that?
  3. rzacharia thread starter macrumors newbie

    Jun 5, 2004
    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.
  4. fayans macrumors 6502a


    Sep 19, 2005
    MacRumors: Forums
    This sounds really annoying. There should be some kind of applescripts to do the job. Why not search from Doug's AppleScripts for iTunes? You might find the answer there. :)
  5. Mitthrawnuruodo Moderator emeritus


    Mar 10, 2004
    Bergen, Norway
    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).
  6. neocell macrumors 65816


    May 23, 2005
    Great White North
    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
  7. belvdr macrumors 603

    Aug 15, 2005
    No longer logging into MR
    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.
  8. rzacharia thread starter macrumors newbie

    Jun 5, 2004
    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
  9. Coheebuzz macrumors 6502

    Oct 10, 2005
    Nicosia, Cyprus
    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!

Share This Page