This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| exiftool [2022-05-27 14:54:50] mi | exiftool [2023-09-10 13:34:33] (current) mi | ||
|---|---|---|---|
| Line 9: | Line 9: | ||
| Add the original Exif date to the beginning of the file name, and also move the file to a folder by year-month. | Add the original Exif date to the beginning of the file name, and also move the file to a folder by year-month. | ||
| - | When using ''-testfile'' instead of the real ''-filename'', it only prints what it would do. | + | When using ''-testname'' instead of the real ''-filename'', it only prints what it would do. | 
| <code bash> | <code bash> | ||
| Line 21: | Line 21: | ||
| exiftool -d "$dest/%Y-%m/%Y-%m-%d_%%f-v%%02.c.%%e" '-filename<DateTimeOriginal' /path/to/process | exiftool -d "$dest/%Y-%m/%Y-%m-%d_%%f-v%%02.c.%%e" '-filename<DateTimeOriginal' /path/to/process | ||
| </code> | </code> | ||
| + | |||
| + | To also process subdirectories, add the ''-r'' (or ''-recurse'') option | ||
| + | |||
| + | To only process files with a .jpg extension, use ''-ext jpg'' (case insensitive) | ||
| + | |||
| + | Example to rename all ".DNG" files in the current directory and it's subdirectories (without moving them): | ||
| + | |||
| + | <code bash> | ||
| + | exiftool -r -ext dng -d "%Y-%m-%d_%%f-v%%02.c.%%e" '-testname<DateTimeOriginal' . | ||
| + | </code> | ||
| + | |||
| + | Special variables in the ''-d'' specification: | ||
| * ''<nowiki>%%f</nowiki>''  : original filename (basename) without extension | * ''<nowiki>%%f</nowiki>''  : original filename (basename) without extension | ||
| Line 42: | Line 54: | ||
| exiftool -r -ext jpg '-FileModifyDate<DateTimeOriginal' /path/to/process | exiftool -r -ext jpg '-FileModifyDate<DateTimeOriginal' /path/to/process | ||
| + | |||
| + | == Copy JPEG Comment to Exif UserComment | ||
| + | |||
| + | For all .jpg files in current directory: | ||
| + | |||
| + | <code bash> | ||
| + | for f in *.jpg; do exiftool "-EXIF:UserComment<FILE:Comment" "$f"; done | ||
| + | </code> | ||
| == See also | == See also | ||
| Line 47: | Line 67: | ||
| * https://exiftool.org/filename.html and the [[https://exiftool.org/faq.html|ExifTool FAQ]] | * https://exiftool.org/filename.html and the [[https://exiftool.org/faq.html|ExifTool FAQ]] | ||
| * This guy's Exiftool Cheatsheet : https://gist.github.com/rjames86/33b9af12548adf091a26 | * This guy's Exiftool Cheatsheet : https://gist.github.com/rjames86/33b9af12548adf091a26 | ||
| + | * And this even better one: [[https://ozzyczech.cz/bash/exiftool-tips-and-tricks/|Exiftool tips & tricks]] | ||