Last active
May 4, 2021 05:31
-
-
Save Canorus/c44f6d7f8e8a5ee6c0f9b51b4eab14d0 to your computer and use it in GitHub Desktop.
move duplicate .mp3 file into 'trashcan' directory, bash >= 4.0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(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