Tidying your .mp3 Music Stash

If you have a bunch of non .mp3/.m4a files in your music stash and you just want to delete them in bulk, to save space, how do you do it?

find /data/Music -type f | grep -v .mp3 | grep -v .m4a | awk -F'zxzxz' '{print "rm -f '\''"$1"'\''"}' | bash

This will search through your stash removing all files except for those discounted (grep -v ). If you have any filenames with zxzxz then there might be an issue otherwise this will sort you out super quick 😉

Author: Andrew

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.