Created
June 11, 2016 16:09
-
-
Save cworks/3e37285a96540c3776a0f0b82f72bf83 to your computer and use it in GitHub Desktop.
Image rename
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
a=1 | |
for i in *.jpg; do | |
new=$(printf "photo%04d.jpg" "$a") #04 pad to length of 4 | |
mv -- "$i" "$new" | |
echo "moved $i to $new" | |
let a=a+1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment