Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I believe there are music files in my iTunes folder that aren’t in my library. How can I remove these files?

share|improve this question
You don't say what your OS is. – BillP3rd Jun 27 '11 at 3:37
If it is a relatively small library or one you don't mind moving, just select all of the files in itunes and copy them to a different location. Then delete the entire contents of the itunes folder, and reimport the songs/whatever. But only do this if you have backed up. Also, check to see if they are taking up much space, if not, then what is the harm in leaving them? – a sandwhich Jun 27 '11 at 5:03
up vote 2 down vote accepted

Well, you can manually do it by exporting the list of music in your library by right clicking the Music in the top left frame and selecting "Export." Then you could compare this to what is inside of your iTunes folder.

This seemed kind of tedious and figured someone out there had already come up with an easier method:

The above script looks promising. As usual, you should back up your files before doing either of the above just in case!

Good luck.

share|improve this answer
Yes, this worked really well for me. Thank you. (Caveat: I’m on the latest iTunes beta and it seems the script is over-eager to show my ringtones as missing from iTunes when that isn’t really the case.) – Alan H. Jun 30 '11 at 18:51

Assuming OS X, although instructions should be very similar for Windows. Open iTunes -> Preferences -> Advanced. Click Change… beside iTunes Media folder location. Select a new location. Click OK.

Then head to File -> Library -> Organize Library…. Click Consolidate files. This will copy all files in your iTunes library to your new location, and will not copy files that are not in your library. Once the copy is completed, delete your old iTunes Media folder. If you like, you can repeat the process to consolidate files back to your original location.

share|improve this answer
Great solution, thanks. – Alan H. Jun 30 '11 at 18:52
This works cross-platform - just performed this procedure on Windows 7/iTunes – nchpmn Sep 7 '13 at 6:46

Not perfect, but I would try the following..

  1. Make sure that the files in question have an access time that is set to much older than the current files.

  2. Install MacPorts.

  3. Install the "find" command/program/utility

  4. Read the endless man page for find.

  5. Use find to list all files with an access time over some value you decide upon - dump their full path locations to a plain text file

  6. Write a tiny script to move everything from the plain text file to a location that you'll leave the files for a while to make sure you don't miss them once you delete them.

An alternative may involve making use of the iTunes preferences for keeping your music folder organized - maybe if you move where iTunes stores its music in your settings, it'll move just the files you're using?

share|improve this answer
Do you really have to manually install find? Pretty sure mine came with - I'd be lost if I couldn't find! This would be the way I'd do it, too, probably. – baraboom Jun 30 '11 at 21:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .