Skip to content

Instantly share code, notes, and snippets.

@nrollr
Last active November 10, 2018 23:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nrollr/476d5b1d4def247ac32b to your computer and use it in GitHub Desktop.
Save nrollr/476d5b1d4def247ac32b to your computer and use it in GitHub Desktop.
Retrieve file location of all items in the iTunes Library
#!/bin/bash
# Extract file location of each item from iTunes Music Library.xml (renamed to iTunes.xml)
sed -n 's/.*<key>Location<\/key><string>\([^<]*\)<\/string>.*/\1/p' iTunes.xml > FileLocation.txt
@nrollr
Copy link
Author

nrollr commented Dec 24, 2015

Output in "FileLocation.txt" looks like:

file:///Volumes/Data/iTunes/Music/Moby/Play/01%20Honey.m4a
file:///Volumes/Data/iTunes/Music/Moby/Play/02%20Find%20My%20Baby.m4a
file:///Volumes/Data/iTunes/Music/Moby/Play/03%20Porcelain.m4a

In my case my iTunes Media Folder location is hosted on my Airport Time Capsule in a directory called iTunes, hence the file:///Volumes/Data/iTunes/- prefix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment