Skip to content

Instantly share code, notes, and snippets.

@danielmorgan
Created August 25, 2017 15:02
Show Gist options
  • Select an option

  • Save danielmorgan/d51fa3cddec8d1eeb3d23894c4291970 to your computer and use it in GitHub Desktop.

Select an option

Save danielmorgan/d51fa3cddec8d1eeb3d23894c4291970 to your computer and use it in GitHub Desktop.
Rename all photos sequentially (a = starting number)
#/bin/bash
a=0
for i in *.JPG; do
new=$(printf "%04d.jpg" "$a")
mv -i -- "$i" "$new"
let a=a+1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment