Skip to content

Instantly share code, notes, and snippets.

@on-three
Last active August 29, 2015 14:05
Show Gist options
  • Save on-three/1c3fe6977153a87c2877 to your computer and use it in GitHub Desktop.
Save on-three/1c3fe6977153a87c2877 to your computer and use it in GitHub Desktop.
convert images and rename in files
cp -r dir1 dir1_copy
#find ./dir1_copy -type f -iname "*.jpg" -exec sh -c "echo {}; mogrify -format png {}; rm {}" \;
find ./dir1_copy -type f -name "*.jpg" -exec sh -c 'echo $1; convert "$1" "${1%.jpg}.png"; rm $1' _ {} \;
find ./dir1_copy -type f -iname "*.txt" -exec sh -c "echo {}; sed -i 's/\.jpg\"/\.png\"/g' {}" \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment