Last active
February 5, 2023 13:12
-
-
Save tatze/ddd44e4eac3a72148847ad06a2a4f052 to your computer and use it in GitHub Desktop.
find images and movies recursively and rename them by prepending their EXIF 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
# add trailing timestamps when missing | |
# needs: exiftool | |
# | |
# Regular files | |
find . -iregex '.*\.jpe?g$' -not -regex '.*/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]_[0-9][0-9][0-9][0-9][0-9][0-9].*' -exec exiftool -q -d "%Y%m%d_%H%M%S-%%f.%%e" "-filename<createdate" {} \; | |
find . -iregex '.*\.mp4$' -not -regex '.*/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]_[0-9][0-9][0-9][0-9][0-9][0-9].*' -exec exiftool -q -d "%Y%m%d_%H%M%S-%%f.%%e" "-filename<createdate" {} \; | |
# | |
# Apple files | |
find . -iregex '.*\.HEIC$' -not -regex '.*/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]_[0-9][0-9][0-9][0-9][0-9][0-9].*' -exec exiftool -q -d "%Y%m%d_%H%M%S-%%f.%%e" "-filename<createdate" {} \; | |
find . -iregex '.*\.mov$' -not -regex '.*/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]_[0-9][0-9][0-9][0-9][0-9][0-9].*' -exec exiftool -q -d "%Y%m%d_%H%M%S-%%f.%%e" "-filename<creationdate" {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment