# Find all files not matching certain music file extensions $ find . -type f -not -iname \*.mp3 -not -iname \*.m4a -not -iname \*.wma -not -iname \*.ogg -not -iname \*.flac # Strip tags from MP3 files $ find . -iname \*.mp3 -exec id3convert -s {} \; # Strip tags from M4A files $ find . -iname \*.m4a -exec AtomicParsley {} --metaEnema --overWrite \; # Strip tags from WMA files (likely to work with other formats too) $ find . -iname \*.wma -exec bash -c "ffmpeg -i '{}' -c copy -map_metadata -1 /tmp/output.wma && mv /tmp/output.wma '{}'" \; # Strip tags from FLAC files $ find . -iname \*.flac -exec metaflac --remove-all {} \; # Strip tags from OGG files $ find . -iname \*.ogg -exec vorbiscomment -w -c /dev/null {} \; # Find directories with two file types tmp=$(mktemp) find . -name '*.mp3' -o -name '*.flac' | sort >"$tmp" comm -12 <(<$tmp sed -n 's!/[^/]*\.mp3$!!p' | sort) \ <(<$tmp sed -n 's!/[^/]*\.flac$!!p' | sort) | uniq rm "$tmp" # Fix permissions $ find . -type d -exec chmod a+rx {} \; $ find . -type f -exec chmod a+r {} \;