cd {folder_with_jpgs}
~/ren.sh {yyyymmdd}
Last active
September 20, 2021 19:56
-
-
Save psiborg/0290732d13061dda046e5b4685b67915 to your computer and use it in GitHub Desktop.
Sequentially rename jpg files in a folder
This file contains hidden or 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 "$1-%04d.jpg" "$a") #04 pad to length of 4 | |
| 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