Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner Author

@nrollr 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