Created
January 17, 2023 18:50
-
-
Save chris-kobrzak/924a48b2cad14e222be114db427a3f33 to your computer and use it in GitHub Desktop.
Find duplicated files sharing names but with different extensions (e.g. Nikon .nef and .jpg files)
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
# in this example we are removing JPG files sitting alongside .nef files | |
for name in `ls * | sed 's/.\{4\}$//' | sort | uniq -d` | |
do | |
# Remove echo below to actually delete files | |
echo rm $name.jpg | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment