Skip to content

Instantly share code, notes, and snippets.

@chris-kobrzak
Created January 17, 2023 18:50
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 chris-kobrzak/924a48b2cad14e222be114db427a3f33 to your computer and use it in GitHub Desktop.
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)
# 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