Skip to content

Instantly share code, notes, and snippets.

Created January 1, 2013 01:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/4424601 to your computer and use it in GitHub Desktop.
Save anonymous/4424601 to your computer and use it in GitHub Desktop.
If you have a bunch of raw/jpg pairs in a directory, this script will remove the raw files that do not have a corresponding jpg.
for raw_file in *.CR2; do; \
jpg_file=`echo $raw_file | sed -e 's/CR2$/JPG/'`; \
if [ ! -f $jpg_file ]; then;
rm $raw_file;
fi;
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment