Bash ftw

So I had a lot (probably 14k) of mp3’s in a messy file organization hierarchy. They were everywhere, and not organized at all. In an attempt to decrease the entropy of my system, I set myself to the task of organizing this giant mess. Luckily, the one thing that I made sure of over the years as I collected music is to have the correct artist and title tags in the mp3’s id3 information header tag. So how do you sort and organize fourteen thousand mp3’s without having to devote a solid month to moving and renaming files? Easy, use bash hacks! 😀 I found a little tool called id3tool that will print out, on the command line, the id3 header information of any mp3 file. So, I wrote a little script to put my music in a ${ARTIST}/${TITLE}.mp3, and ran it using

for file in `find . | grep .mp3`; do /usr/local/bin/musicsort $file; done

and let it run. In short order, my collection was nice and clean and I didn’t have to waste much time doing it! Learn bash and the CLI if you haven’t already, it definitely will save you a lot of time…

This entry was posted in Coding, Open Source. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *