Skip to content

Instantly share code, notes, and snippets.

@Canorus
Last active May 4, 2021 05:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Canorus/c44f6d7f8e8a5ee6c0f9b51b4eab14d0 to your computer and use it in GitHub Desktop.
Save Canorus/c44f6d7f8e8a5ee6c0f9b51b4eab14d0 to your computer and use it in GitHub Desktop.
move duplicate .mp3 file into 'trashcan' directory, bash >= 4.0
$(shopt -s globstar)
if ! [ -d trashcan ]; then
mkdir trashcan
fi
for file in */**/*\ 1.mp3;
do
if [ -f "${file/ 1.mp3/.mp3}" ] ; then
echo $file
mv "$file" trashcan/
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment