Last active
January 1, 2016 04:49
-
-
Save bjoern-r/8094560 to your computer and use it in GitHub Desktop.
rename pictures and movies according the exif or file timestamp
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
## resulting filename 20121018-102347-IMG_4743.jpg | |
## rename pictures | |
jhead -n%Y%m%d-%H%M%S-%f *.JPG | tee rename.log | |
## create restore script | |
awk '{ print "mv " $3 " " $1 }' rename.log >rename_undo.sh | |
## rename movies | |
stat -t"%Y%m%d-%H%M%S" *.MOV | awk '{ print "echo mv " $16 " " $10"-"$16 }' | sh | tee rename-mov.log | sh -x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment