Created
October 15, 2012 23:42
-
-
Save phs/3896391 to your computer and use it in GitHub Desktop.
Compare /iTunes/Music against a Library.xml in the local directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Open up Terminal.app, cd to the directory containing Library.xml, then paste this bad boy. | |
# | |
# What's going on: | |
# 1. find: recursively print the names of all files under /iTunes/Music | |
# 2. sed: Strip off the leading '/iTunes/Music/' prefix, since it probably won't be in Library.xml | |
# 3. while: for each such filename.. | |
# 4. grep: see if it appears in Library.xml | |
# 5. ||, echo: if not, print it out. | |
find /iTunes/Music -type f | sed 's|/iTunes/Music/||g' | while read filename; do grep -q "$filename" Library.xml || echo "$filename"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment