Skip to content

Instantly share code, notes, and snippets.

@camb416
Created February 19, 2016 17:41
Show Gist options
  • Save camb416/1f9f7b1e21c7b1c02a78 to your computer and use it in GitHub Desktop.
Save camb416/1f9f7b1e21c7b1c02a78 to your computer and use it in GitHub Desktop.
rename all of the JPG images in this folder to sequence numbers.
#!/bin/bash
# rename all of the JPG images in this folder to sequence numbers.
a=1
for i in *.jpg; do
new=$(printf "%05d.jpg" "$a") #04 pad to length of 5 digits
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