Deleting Bad Music with Amarok and BASH

I have been keeping track of bad music I have for a long time.  Today, I found out the number of bad tracks has hit 10,675.  That’s a lot of wasted space!  So, I tried to use an Amarok script to move the files to a directory I lovingly titled BADBADBAD, but it stopped after just a few tracks.  Strange…

Then, I saw in the Amarok playlist menu a way to export to a file!  Just add all the tracks you don’t like to a PLS file using the Export Playlist As… option, and run the following, replacing what’s necessary:

grep -E "^File" todelete.pls | cut -f 2 -d = | while read a; do mv "$a" /nexus/tardis/Music/BADBADBAD/; done

And you’re done!

hank@tardis:/nexus/tardis/Music/BADBADBAD$ du -sh
54G	.

I think a 54GB savings is pretty darn good!