Skip to content

Instantly share code, notes, and snippets.

@aniketpant
Created May 6, 2013 04:42
Show Gist options
  • Save aniketpant/5523398 to your computer and use it in GitHub Desktop.
Save aniketpant/5523398 to your computer and use it in GitHub Desktop.
A simple script to clean up your music folder. Removes all directories not containing the mentioned file types.
find . | while read -r f; do [ -z "`find "$f" -type f -iname "*.mp3" -o -iname "*.flac" -o -iname "*.m4a" -o -iname "*.ogg" -o -iname "*.mp4" -o -iname "*.wma"`" ] && rm -iRf "$f"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment