Duplicate File Deletion

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

  1. rzacharia macrumors newbie

    Joined:
    Jun 5, 2004
    #1
    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!
     
  2. stoid macrumors 601

    stoid

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

    Joined:
    Jun 5, 2004
    #3
    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

    fayans

    Joined:
    Sep 19, 2005
    Location:
    MacRumors: Forums
    #4
    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

    Mitthrawnuruodo

    Joined:
    Mar 10, 2004
    Location:
    Bergen, Norway
    #5
    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

    neocell

    Joined:
    May 23, 2005
    Location:
    Great White North
    #6
    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 601

    Joined:
    Aug 15, 2005
    #7
    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

    Joined:
    Jun 5, 2004
    #8
    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

    Joined:
    Oct 10, 2005
    Location:
    Nicosia, Cyprus
    #9
    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