Skip to content

Instantly share code, notes, and snippets.

@TahirJalilov
Last active March 15, 2023 21:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TahirJalilov/e3c445c3794d432ce30f5f5c7282cb5a to your computer and use it in GitHub Desktop.
Save TahirJalilov/e3c445c3794d432ce30f5f5c7282cb5a to your computer and use it in GitHub Desktop.
exiftool photo and video renamer with date and time
# rename file by creation date
exiftool '-filename<CreateDate' -d '%Y%m%d_%H%M%S%%-c.%%le' -r ./
perl-rename -v 's/(\d{4})-(\d{2})-(\d{2}) (\d{2}).(\d{2}).(\d{2})/$1$2$3_$4$5$6/' *
# remove IMG or VID prefix
perl-rename -v 's/(IMG)_(\d{8})_(\d{6})/$2_$3/' *
perl-rename -v 's/(VID)_(\d{8})_(\d{6})/$2_$3/' *
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment