Skip to content

Instantly share code, notes, and snippets.

@edele
Last active August 29, 2015 14:08
Show Gist options
  • Select an option

  • Save edele/318384f8719223a27e5a to your computer and use it in GitHub Desktop.

Select an option

Save edele/318384f8719223a27e5a to your computer and use it in GitHub Desktop.
bash rename numberize
# first make sure there are no CAPSED extensions
a=1
for i in *.JPG; do
new=$(printf "%02d.jpg" ${a})
mv ${i} ${new}
let a=a+1
done
# now let computer do all the stupid work
a=1
for i in *.jpg; do
new=$(printf "%02d.jpg" ${a})
mv ${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