Skip to content

Instantly share code, notes, and snippets.

@filviu
Created October 11, 2021 09:13
Show Gist options
  • Save filviu/ea4a1d159a8ebe679a4d9446d986a25a to your computer and use it in GitHub Desktop.
Save filviu/ea4a1d159a8ebe679a4d9446d986a25a to your computer and use it in GitHub Desktop.
Move jpeg files to a subfolder if an identical named RAW faile exists. Rename CR2 to particular RAW
#!/bin/bash
ls -1 *.JPG | while read filename; do
extension="${filename##*.}"
filename="${filename%.*}"
if [ -f "${filename}.CR2" ]; then
#echo "${filename}"
mkdir -p t
mv "${filename}.JPG" t/
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment