Exporting the filepath of all music files to a text file

I'd love to know the syntax within Terminal to export the filename and path of all my music of various types (I have legacy Windows .wma files too). I'd presumably export those file to a .txt or .xls file and sort by path.

My ultimate problem is my music is in many different folders (somewhere between 3 and 10 main places) and contain many duplicates - like 40GB of duplicates. I keep wasting time with software that doesn't work, but if I know where all the music is located (and exactly how big the files are), I can know how to better attack the problem - i.e., maybe I'll just drag them to a Windows machine (via a HD or Dropbox) where their folder merge options work better.


You might just use find:

find ~/Music > ~/music.txt

Or add for example -iname \*.mp3 to only include files that end with .mp3:

find ~/Music -iname \*.m4a -o -iname \*.mp3 -o -iname \*.flac -o -iname \*.wma > ~/music.txt

If the problem is that your music is scattered throughout your directories and not contained within your ~/Music folder - and if you want to export the paths to a file - then you would want to do this:

find ~/ -iname \*.m4a -o -iname \*.mp3 -o -iname \*.flac -o -iname \*.wma > ~/Desktop/music.txt