Skip to content

Instantly share code, notes, and snippets.

@wimvds
Created November 24, 2016 08:18
Show Gist options
  • Save wimvds/65a95ebed34061774396af7f86c2395e to your computer and use it in GitHub Desktop.
Save wimvds/65a95ebed34061774396af7f86c2395e to your computer and use it in GitHub Desktop.
Remove an mp3 duplicate (m4a with same name exists in the same folder)
#!/bin/bash
# Usage:
# find ~/Music -name '*.m4a' -exec ~/bin/remove-dupe.sh {} \;
M4A_FILE=$1
MP3_FILE="${M4A_FILE%.*}.mp3"
if [ -f "$MP3_FILE" ]; then
rm -rf "$MP3_FILE"
echo "Removed $MP3_FILE"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment