Skip to content

Instantly share code, notes, and snippets.

@SBejga
Created November 24, 2014 20:44
Show Gist options
  • Save SBejga/f60d24b44a8257bd8d6f to your computer and use it in GitHub Desktop.
Save SBejga/f60d24b44a8257bd8d6f to your computer and use it in GitHub Desktop.
Lightroom Raw+JPG Remover of JPG files
#!/bin/bash
#change this to folder with target files/folders inside.
root=~/Pictures/2014
for f in $(find $root -name '*.CR2' -or -name '*.ARW');
do
fname=`echo $f | cut -d\. -f1`
if [ -e $fname.jpg ]
then
rm $fname.jpg
elif [ -e $fname.JPG ]
then
rm $fname.JPG
elif [ -e $fname.jpeg ]
then
rm $fname.jpeg
elif [ -e $fname.JPEG ]
then
rm $fname.JPEG
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment