- https://github.com/JochenHayek/misc/blob/master/jpg-exif-suggest-rename-as_vouchers.sh
- https://github.com/JochenHayek/misc/blob/master/jpg-exif-suggest-rename-versioned.sh
- https://github.com/JochenHayek/misc/blob/master/pdf-suggest-rename-as_vouchers.sh
- https://github.com/JochenHayek/misc/blob/master/pdf-suggest-rename-versioned.sh
For accessing the EXIF header there are a couple of utilities available, “exif –xml-ouptut” and “exiftool -s”; for PDF the package “xpdf” provides a utility called “pdfinfo -meta -rawdates”. All of them can provide you with quite a few date-time-strings from the respective heards.
Long ago I wrapped these utilities in nice little shell scripts, that take all these date-time-strings and list the possible renaming commands with descriptive comments (“mv … … # …”) on STDOUT, so that you can pick from the alternatives.
One variant of my wrapper scripts suggests renamings, that put the date-time-string at the beginning of your file name, so that your files will get sorted by the date and time, that they got created on – that’s usually, what I pick.
The other variant puts the date-time-string right before the extension of the file.