neulab/tldr huggingface dataset:
Multiple -geotag options may be used to concatenate GPS track log data.  Also, a single -geotag option may be used to load multiple track log files by using wildcards in the TRKFILE name, but note that in this case TRKFILE must be quoted on most systems (with the notable exception of Windows) to prevent filename expansion.  For example:
exiftool -geotag "TRACKDIR/*.log" IMAGEDIR
Currently supported track file formats are GPX, NMEA RMC/GGA/GLL, KML, IGC, Garmin XML and TCX, Magellan PMGNTRK, Honeywell PTNTHPR, Bramor gEO, Winplus Beacon TXT, and GPS/IMU CSV files.  See "GEOTAGGING EXAMPLES" for examples. Also see "geotag.html" in the full ExifTool distribution and the Image::ExifTool Options for more details and for information about geotag configuration options.
-globalTimeShift SHIFT Shift all formatted date/time values by the specified amount when reading.  Does not apply to unformatted (-n) output.  SHIFT takes the same form as the date/time shift when writing (see Image::ExifTool::Shift.pl for details), with a negative shift being indicated with a minus sign ("-") at the start of the SHIFT string. For example:
# return all date/times, shifted back by 1 hour exiftool -globalTimeShift -1 -time:all a.jpg
# set the file name from the shifted CreateDate (-1 day) for # all images in a directory exiftool "-filename<createdate" -globaltimeshift "-0:0:1 0:0:0" \ -d %Y%m%d-%H%M%S.%%e dir
-use MODULE Add features from specified plug-in MODULE.  Currently, the MWG module is the only plug-in module distributed with exiftool.  This module adds read/write support for tags as recommended by the Metadata Working Group.  As a convenience, "-use MWG" is assumed if the "MWG" group is specified for any tag on the command line.  See the MWG Tags documentation for more details.  Note that this option is not reversible, and remains in effect until the application terminates, even across the -execute option.
-restore_original -delete_original[!] These utility options automate the maintenance of the "_original" files created by exiftool.  They have no effect on files without an "_original" copy.  The -restore_original option restores the specified files from their original copies by renaming the "_original" files to replace the edited versions.  For example, the following command restores the originals of all JPG images in directory "DIR":
exiftool -restore_original -ext jpg DIR
The -delete_original option deletes the "_original" copies of all files specified on the command line.  Without a trailing "!" this option prompts for confirmation before continuing.  For example, the following command deletes "a.jpg_original" if it exists, after asking "Are you sure?":
exiftool -delete_original a.jpg
These options may not be used with other options to read or write tag values in the same command, but may be combined with options such -ext, -if, -r, -q and -v.
Among other things, the advanced options allow complex processing to be performed from a single command without the need for additional scripting.  This may be particularly useful for implementations such as Windows drag-and-drop applications.  These options may also be used to improve performance in multi-pass processing by reducing the overhead required to load exiftool for each invocation.
-api OPT[[^]=[VAL]] Set ExifTool API option.  OPT is an API option name.  The option value is set to 1 if =VAL is omitted.  If VAL is omitted, the option value is set to undef if "=" is used, or an empty string with "^=". See Image::ExifTool Options for a list of available API options. This overrides API options set via the config file.
-common_args Specifies that all arguments following this option are common to all executed commands when -execute is used.  This and the -config option are the only options that may not be used inside a -@ ARGFILE.  Note that by definition this option and its arguments MUST come after all other options on the command line.
-config CFGFILE Load specified configuration file instead of the default ".ExifTool_config".  If used, this option must come before all other arguments on the command line and applies to all -execute'd commands.  The CFGFILE must exist relative to the current working directory or the exiftool application directory unless an absolute path is specified.  Loading of the default config file may be disabled by setting CFGFILE to an empty string (ie.  "").  See <https://exiftool.org/config.html> and config_files/example.config in the full ExifTool distribution for details about the configuration file syntax.
-echo[NUM] TEXT Echo TEXT to stdout (-echo or -echo1) or stderr (-echo2).  Text is output as the command line is parsed, before the processing of any input files.  NUM may also be 3 or 4 to output text (to stdout or stderr respectively) after processing is complete.  For -echo3 and -echo4, "${status}" may be used in the TEXT string to represent the numerical exit status of the command (see "EXIT STATUS").
-efile[NUM][!] ERRFILE Save the names of files giving errors (NUM missing or 1), files that were unchanged (NUM is 2), files that fail the -if condition (NUM is 4), or any combination thereof by summing NUM (eg. -efile3 is the same has having both -efile and -efile2 options with the same ERRFILE).  By default, file names are appended to any existing ERRFILE, but ERRFILE is overwritten if an exclamation point is added to the option (eg. -efile!).  Saves the name of the file specified by the -srcfile option if applicable.
-execute[NUM] Execute command for all arguments up to this point on the command line (plus any arguments specified by -common_args).  The result is as if the commands were executed as separate command lines (with the exception of the -config and -use options which remain in effect for subsequent commands).  Allows multiple commands to be executed from a single command line.  NUM is an optional number that is echoed in the "{ready}" message when using the -stay_open feature.  If a NUM is specified, the -q option no longer suppresses the output "{readyNUM}" message.
-list_dir List directories themselves instead of their contents.  This option effectively causes directories to be treated as normal files when reading and writing.  For example, with this option the output of the "ls -la" command on Mac/Linux may be approximated by this exiftool command:
exiftool -list_dir -T -ls-l -api systemtags -fast5 .* *
(The -T option formats the output in tab-separated columns, -ls-l is a shortcut tag, the API SystemTags option is required to extract some necessary tags, and the -fast5 option is added for speed since only system tags are being extracted.)
-srcfile FMT Specify a different source file to be processed based on the name of the original FILE.  This may be useful in some special situations for processing related preview images or sidecar files.  See the -w option for a description of the FMT syntax.  Note that file name FMT strings for all options are based on the original FILE specified from the command line, not the name of the source file specified by -srcfile.
For example, to copy metadata from NEF files to the corresponding JPG previews in a directory where other JPG images may exist:
exiftool -ext nef -tagsfromfile @ -srcfile %d%f.jpg dir
If more than one -srcfile option is specified, the files are tested in order and the first existing source file is processed.  If none of the source files already exist, then exiftool uses the first -srcfile specified.
A FMT of "@" may be used to represent the original FILE, which may be useful when specifying multiple -srcfile options (eg. to fall back to processing the original FILE if no sidecar exists).
When this option is used, two special UserParam tags (OriginalFileName and OriginalDirectory) are generated to allow access to the original FILE name and directory.
-stay_open FLAG If FLAG is 1 or "True" (case insensitive), causes exiftool keep reading from the -@ ARGFILE even after reaching the end of file. This feature allows calling applications to pre-load exiftool, thus avoiding the overhead of loading exiftool for each command.  The procedure is as follows:
1) Execute "exiftool -stay_open True -@ ARGFILE", where ARGFILE is the name of an existing (possibly empty) argument file or "-" to pipe arguments from the standard input.
2) Write exiftool command-line arguments to ARGFILE, one argument per line (see the -@ option for details).
3) Write "-execute\n" to ARGFILE, where "\n" represents a newline sequence.  (Note: You may need to flush your write buffers here if using buffered output.)  ExifTool will then execute the command with the arguments received up to this point, send a "{ready}" message to stdout when done (unless the -q or -T option is used), and continue trying to read arguments for the next command from ARGFILE.  To aid in command/response synchronization, any number appended to the -execute option is echoed in the "{ready}" message.  For example, "-execute613" results in "{ready613}".  When this number is added, -q no longer suppresses the "{ready}" message.  (Also, see the -echo3 and -echo4 options for additional ways to pass signals back to your application.)
4) Repeat steps 2 and 3 for each command.
5) Write "-stay_open\nFalse\n" (or "-stay_open\n0\n") to ARGFILE when done.  This will cause exiftool to process any remaining command-line arguments then exit normally.
The input ARGFILE may be changed at any time before step 5 above by writing the following lines to the currently open ARGFILE:
-stay_open True -@ NEWARGFILE
This causes ARGFILE to be closed, and NEWARGFILE to be kept open. (Without the -stay_open here, exiftool would have returned to reading arguments from ARGFILE after reaching the end of NEWARGFILE.)
Note:  When writing arguments to a disk file there is a delay of up to 0.01 seconds after writing "-execute\n" before exiftool starts processing the command.  This delay may be avoided by sending a CONT signal to the exiftool process immediately after writing "-execute\n".  (There is no associated delay when writing arguments via a pipe with "-@ -", so the signal is not necessary when using this technique.)
-userParam PARAM[[^]=[VAL]] Set user parameter.  PARAM is an arbitrary user parameter name. This is an interface to the API UserParam option (see the Image::ExifTool Options documentation), and provides a method to access user-defined parameters in arguments to the -if and -p options as if they were any other tag.  Appending a hash tag ("#") to PARAM (eg. "-userParam MyTag#=yes") also causes the parameter to be extracted as a normal tag in the UserParam group.  Similar to the -api option, the parameter value is set to 1 if =VAL is omitted, undef if just VAL is omitted with "=", or an empty string if VAL is omitted with "^=".
exiftool -p '$test from $filename' -userparam test=Hello FILE
Advanced formatting feature
An advanced formatting feature allows modification of the value of any tag interpolated within a -if or -p option argument, or a -tagsFromFile redirection string.  Tag names within these strings are prefixed by a "$" symbol, and an arbitrary Perl expression may be applied to the tag value by placing braces around the tag name and inserting the expression after the name, separated by a semicolon (ie. "${TAG;EXPR}").  The expression acts on the value of the tag through the default input variable ($_), and has access to the full ExifTool API through the current ExifTool object ($self) and the tag key ($tag).  It may contain any valid Perl code, including translation ("tr///") and substitution ("s///") operations, but note that braces within the expression must be balanced.  The example below prints the camera Make with spaces translated to underlines, and multiple consecutive underlines replaced by a single underline:
exiftool -p '${make;tr/ /_/;s/__+/_/g}' image.jpg
An "@" may be added after the tag name to make the expression act on individual list items for list-type tags, simplifying list processing. Set $_ to undef to remove an item from the list.  As an example, the following command returns all subjects not containing the string "xxx":
exiftool -p '${subject@;$_=undef if /xxx/}' image.jpg
A default expression of "tr(/\\?*:|"<>\0)()d" is assumed if the expression is empty (ie. "${TAG;}").  This removes the characters / \ ? * : | < > and null from the printed value.  (These characters are illegal in Windows file names, so this feature is useful if tag values are used in file names.)
"DateFmt"
Simplifies reformatting of individual date/time values.  This function acts on a standard EXIF-formatted date/time value in $_ and formats it according to the specified format string (see the -d option).  To avoid trying to reformat an already-formatted date/time value, a "#" must be added to the tag name (as in the example below) if the -d option is also used.  For example:
exiftool -p '${createdate#;DateFmt("%Y-%m-%d_%H%M%S")}' a.jpg
"ShiftTime"
Shifts EXIF-formatted date/time string by a specified amount.  Start with a leading minus sign to shift backwards in time.  See Image::ExifTool::Shift.pl for details about shift syntax.  For example, to shift a date/time value back by one year:
exiftool -p '${createdate;ShiftTime("-1:0:0 0")}' a.jpg
"NoDups"
Removes duplicate items from a list with a separator specified by the -sep option.  This function is most useful when copying list-type tags. For example, the following command may be used to remove duplicate Keywords:
exiftool -sep '##' '-keywords<${keywords;NoDups}' a.jpg
The -sep option is necessary to split the string back into individual list items when writing to a list-type tag.
An optional flag argument may be set to 1 to cause "NoDups" to set $_ to undef if no duplicates existed, thus preventing the file from being rewritten unnecessarily:
exiftool -sep '##' '-keywords<${keywords;NoDups(1)}' a.jpg
Note that function names are case sensitive.
In Windows, command-line arguments are specified using the current code page and are recoded automatically to the system code page.  This recoding is not done for arguments in ExifTool arg files, so by default filenames in arg files use the system code page.  Unfortunately, these code pages are not complete character sets, so not all file names may be represented.
ExifTool 9.79 and later allow the file name encoding to be specified with "-charset filename=CHARSET", where "CHARSET" is the name of a valid ExifTool character set, preferably "UTF8" (see the -charset option for a complete list).  Setting this triggers the use of Windows wide-character i/o routines, thus providing support for most Unicode file names (see note 4).  But note that it is not trivial to pass properly encoded file names on the Windows command line (see <https://exiftool.org/faq.html#Q18> for details), so placing them in a UTF-8 encoded -@ argfile and using "-charset filename=utf8" is recommended if possible.
A warning is issued if a specified filename contains special characters and the filename character set was not provided.  However, the warning may be disabled by setting "-charset filename=""", and ExifTool may still function correctly if the system code page matches the character set used for the file names.
When a directory name is provided, the file name encoding need not be specified (unless the directory name contains special characters), and ExifTool will automatically use wide-character routines to scan the directory.
The filename character set applies to the FILE arguments as well as filename arguments of -@, -geotag, -o, -p, -srcfile, -tagsFromFile, -csv=, -j= and -TAG<=.  However, it does not apply to the -config filename, which always uses the system character set.  The "-charset filename=" option must come before the -@ option to be effective, but the order doesn't matter with respect to other options.
1) FileName and Directory tag values still use the same encoding as other tag values, and are converted to/from the filename character set when writing/reading if specified.
2) Unicode support is not yet implemented for other Windows-based systems like Cygwin.
3) See "WRITING READ-ONLY FILES" below for a note about editing read-only files with Unicode names.
4) Unicode file names with surrogate pairs (code points over U+FFFF) still cause problems.
WRITING READ-ONLY FILES In general, ExifTool may be used to write metadata to read-only files provided that the user has write permission in the directory.  However, there are three cases where file write permission is also required:
1) When using the -overwrite_original_in_place option.
2) When writing only pseudo System tags (eg. FileModifyDate).
3) On Windows if the file has Unicode characters in its name, and a) the -overwrite_original option is used, or b) the "_original" backup already exists.
Hidden files in Windows behave as read-only files when attempting to write any real tags to the file -- an error is generated when using the -overwrite_original_in_place, otherwise writing should be successful and the hidden attribute will be removed.  But the -if option may be used to avoid processing hidden files (provided Win32API::File is available):
exiftool -if "$fileattributes !~ /Hidden/" ...
Note: Beware when cutting and pasting these examples into your terminal! Some characters such as single and double quotes and hyphens may have been changed into similar-looking yet functionally-different characters by the text formatter used to display this documentation.  Also note that Windows users must use double quotes instead of single quotes as below around arguments containing special characters.
exiftool -a -u -g1 a.jpg Print all meta information in an image, including duplicate and unknown tags, sorted by group (for family 1).  For performance reasons, this command may not extract all available metadata. (Metadata in embedded documents, metadata extracted by external utilities, and metadata requiring excessive processing time may not be extracted).  Add "-ee3" and "-api RequestAll=3" to the command to extract absolutely everything available.
exiftool -common dir Print common meta information for all images in "dir".  "-common" is a shortcut tag representing common EXIF meta information.
exiftool -T -createdate -aperture -shutterspeed -iso dir > out.txt List specified meta information in tab-delimited column form for all images in "dir" to an output text file named "out.txt".
exiftool -s -ImageSize -ExposureTime b.jpg Print ImageSize and ExposureTime tag names and values.
exiftool -l -canon c.jpg d.jpg Print standard Canon information from two image files.
exiftool -r -w .txt -common pictures Recursively extract common meta information from files in "pictures" directory, writing text output to ".txt" files with the same names.
exiftool -b -ThumbnailImage image.jpg > thumbnail.jpg Save thumbnail image from "image.jpg" to a file called "thumbnail.jpg".
exiftool -b -JpgFromRaw -w _JFR.JPG -ext NEF -r . Recursively extract JPG image from all Nikon NEF files in the current directory, adding "_JFR.JPG" for the name of the output JPG files.
exiftool -a -b -W %d%f_%t%-c.%s -preview:all dir Extract all types of preview images (ThumbnailImage, PreviewImage, JpgFromRaw, etc.) from files in directory "dir", adding the tag name to the output preview image file names.
exiftool -d '%r %a, %B %e, %Y' -DateTimeOriginal -S -s -ext jpg . Print formatted date/time for all JPG files in the current directory.
exiftool -IFD1:XResolution -IFD1:YResolution image.jpg Extract image resolution from EXIF IFD1 information (thumbnail image IFD).
exiftool '-*resolution*' image.jpg Extract all tags with names containing the word "Resolution" from an image.
exiftool -xmp:author:all -a image.jpg Extract all author-related XMP information from an image.
exiftool -xmp -b a.jpg > out.xmp Extract complete XMP data record intact from "a.jpg" and write it to "out.xmp" using the special "XMP" tag (see the Extra tags in Image::ExifTool::TagNames).
exiftool -p '$filename has date $dateTimeOriginal' -q -f dir Print one line of output containing the file name and DateTimeOriginal for each image in directory "dir".
exiftool -ee3 -p '$gpslatitude, $gpslongitude, $gpstimestamp' a.m2ts Extract all GPS positions from an AVCHD video.
exiftool -icc_profile -b -w icc image.jpg Save complete ICC_Profile from an image to an output file with the same name and an extension of ".icc".
exiftool -htmldump -w tmp/%f_%e.html t/images Generate HTML pages from a hex dump of EXIF information in all images from the "t/images" directory.  The output HTML files are written to the "tmp" directory (which is created if it didn't exist), with names of the form 'FILENAME_EXT.html'.
exiftool -a -b -ee -embeddedimage -W Image_%.3g3.%s file.pdf Extract embedded JPG and JP2 images from a PDF file.  The output images will have file names like "Image_#.jpg" or "Image_#.jp2", where "#" is the ExifTool family 3 embedded document number for the image.
Note that quotes are necessary around arguments which contain certain special characters such as ">", "<" or any white space.  These quoting techniques are shell dependent, but the examples below will work for most Unix shells.  With the Windows cmd shell however, double quotes should be used (eg. -Comment="This is a new comment").
exiftool -Comment='This is a new comment' dst.jpg Write new comment to a JPG image (replaces any existing comment).
exiftool -comment= -o newdir -ext jpg . Remove comment from all JPG images in the current directory, writing the modified images to a new directory.
exiftool -keywords=EXIF -keywords=editor dst.jpg Replace existing keyword list with two new keywords ("EXIF" and "editor").
exiftool -Keywords+=word -o newfile.jpg src.jpg Copy a source image to a new file, and add a keyword ("word") to the current list of keywords.
exiftool -exposurecompensation+=-0.5 a.jpg Decrement the value of ExposureCompensation by 0.5 EV.  Note that += with a negative value is used for decrementing because the -= operator is used for conditional deletion (see next example).
exiftool -credit-=xxx dir Delete Credit information from all files in a directory where the Credit value was "xxx".
exiftool -xmp:description-de='k&uuml;hl' -E dst.jpg Write alternate language for XMP:Description, using HTML character escaping to input special characters.
exiftool -all= dst.jpg Delete all meta information from an image.  Note: You should NOT do this to RAW images (except DNG) since proprietary RAW image formats often contain information in the makernotes that is necessary for converting the image.
exiftool -all= -comment='lonely' dst.jpg Delete all meta information from an image and add a comment back in. (Note that the order is important: "-comment='lonely' -all=" would also delete the new comment.)
exiftool -all= --jfif:all dst.jpg Delete all meta information except JFIF group from an image.
exiftool -Photoshop:All= dst.jpg Delete Photoshop meta information from an image (note that the Photoshop information also includes IPTC).
exiftool -r -XMP-crss:all= DIR Recursively delete all XMP-crss information from images in a directory.
exiftool '-ThumbnailImage<=thumb.jpg' dst.jpg Set the thumbnail image from specified file (Note: The quotes are necessary to prevent shell redirection).
exiftool '-JpgFromRaw<=%d%f_JFR.JPG' -ext NEF -r . Recursively write JPEG images with filenames ending in "_JFR.JPG" to the JpgFromRaw tag of like-named files with extension ".NEF" in the current directory.  (This is the inverse of the "-JpgFromRaw" command of the "READING EXAMPLES" section above.)
exiftool -DateTimeOriginal-='0:0:0 1:30:0' dir Adjust original date/time of all images in directory "dir" by subtracting one hour and 30 minutes.  (This is equivalent to "-DateTimeOriginal-=1.5".  See Image::ExifTool::Shift.pl for details.)
exiftool -createdate+=3 -modifydate+=3 a.jpg b.jpg Add 3 hours to the CreateDate and ModifyDate timestamps of two images.
exiftool -AllDates+=1:30 -if '$make eq "Canon"' dir Shift the values of DateTimeOriginal, CreateDate and ModifyDate forward by 1 hour and 30 minutes for all Canon images in a directory.  (The AllDates tag is provided as a shortcut for these three tags, allowing them to be accessed via a single tag.)
exiftool -xmp:city=Kingston image1.jpg image2.nef Write a tag to the XMP group of two images.  (Without the "xmp:" this tag would get written to the IPTC group since "City" exists in both, and IPTC is preferred by default.)
exiftool -LightSource-='Unknown (0)' dst.tiff Delete "LightSource" tag only if it is unknown with a value of 0.
exiftool -whitebalance-=auto -WhiteBalance=tung dst.jpg Set "WhiteBalance" to "Tungsten" only if it was previously "Auto".
exiftool -comment-= -comment='new comment' a.jpg Write a new comment only if the image doesn't have one already.
exiftool -o %d%f.xmp dir Create XMP meta information data files for all images in "dir".
exiftool -o test.xmp -owner=Phil -title='XMP File' Create an XMP data file only from tags defined on the command line.
exiftool '-ICC_Profile<=%d%f.icc' image.jpg Write ICC_Profile to an image from a ".icc" file of the same name.
exiftool -hierarchicalkeywords='{keyword=one,children={keyword=B}}' Write structured XMP information.  See <https://exiftool.org/struct.html> for more details.
exiftool -trailer:all= image.jpg Delete any trailer found after the end of image (EOI) in a JPEG file.  A number of digital cameras store a large PreviewImage after the JPEG EOI, and the file size may be reduced significantly by deleting this trailer.  See the JPEG Tags documentation for a list of recognized JPEG trailers.
These examples demonstrate the ability to copy tag values between files.
exiftool -tagsFromFile src.cr2 dst.jpg Copy the values of all writable tags from "src.cr2" to "dst.jpg", writing the information to same-named tags in the preferred groups.
exiftool -TagsFromFile src.jpg -all:all dst.jpg Copy the values of all writable tags from "src.jpg" to "dst.jpg", preserving the original tag groups.
exiftool -all= -tagsfromfile src.jpg -exif:all dst.jpg Erase all meta information from "dst.jpg" image, then copy EXIF tags from "src.jpg".
exiftool -exif:all= -tagsfromfile @ -all:all -unsafe bad.jpg Rebuild all EXIF meta information from scratch in an image.  This technique can be used in JPEG images to repair corrupted EXIF information which otherwise could not be written due to errors.  The "Unsafe" tag is a shortcut for unsafe EXIF tags in JPEG images which are not normally copied.  See the tag name documentation for more details about unsafe tags.
exiftool -Tagsfromfile a.jpg out.xmp Copy meta information from "a.jpg" to an XMP data file.  If the XMP data file "out.xmp" already exists, it will be updated with the new information.  Otherwise the XMP data file will be created.  Only metadata-only files may be created like this (files containing images may be edited but not created).  See "WRITING EXAMPLES" above for another technique to generate XMP files.
exiftool -tagsFromFile a.jpg -XMP:All= -ThumbnailImage= -m b.jpg Copy all meta information from "a.jpg" to "b.jpg", deleting all XMP information and the thumbnail image from the destination.
exiftool -TagsFromFile src.jpg -title -author=Phil dst.jpg Copy title from one image to another and set a new author name.
exiftool -TagsFromFile a.jpg -ISO -TagsFromFile b.jpg -comment dst.jpg Copy ISO from one image and Comment from another image to a destination image.
exiftool -tagsfromfile src.jpg -exif:all --subifd:all dst.jpg Copy only the EXIF information from one image to another, excluding SubIFD tags.
exiftool '-FileModifyDate<DateTimeOriginal' dir Use the original date from the meta information to set the same file's filesystem modification date for all images in a directory. (Note that "-TagsFromFile @" is assumed if no other -TagsFromFile is specified when redirecting information as in this example.)
exiftool -TagsFromFile src.jpg '-xmp:all<all' dst.jpg Copy all possible information from "src.jpg" and write in XMP format to "dst.jpg".
exiftool '-Description<${FileName;s/\.[^.]*$//}' dir Set the image Description from the file name after removing the extension.  This example uses the "Advanced formatting feature" to perform a substitution operation to remove the last dot and subsequent characters from the file name.
exiftool -@ iptc2xmp.args -iptc:all= a.jpg Translate IPTC information to XMP with appropriate tag name conversions, and delete the original IPTC information from an image. This example uses iptc2xmp.args, which is a file included with the ExifTool distribution that contains the required arguments to convert IPTC information to XMP format.  Also included with the distribution are xmp2iptc.args (which performs the inverse conversion) and a few more .args files for other conversions between EXIF, IPTC and XMP.
exiftool -tagsfromfile %d%f.CR2 -r -ext JPG dir Recursively rewrite all "JPG" images in "dir" with information copied from the corresponding "CR2" images in the same directories.
exiftool '-keywords+<make' image.jpg Add camera make to list of keywords.
exiftool '-comment<ISO=$exif:iso Exposure=${shutterspeed}' dir Set the Comment tag of all images in "dir" from the values of the EXIF:ISO and ShutterSpeed tags.  The resulting comment will be in the form "ISO=100 Exposure=1/60".
exiftool -TagsFromFile src.jpg -icc_profile dst.jpg Copy ICC_Profile from one image to another.
exiftool -TagsFromFile src.jpg -all:all dst.mie Copy all meta information in its original form from a JPEG image to a MIE file.  The MIE file will be created if it doesn't exist.  This technique can be used to store the metadata of an image so it can be inserted back into the image (with the inverse command) later in a workflow.
exiftool -o dst.mie -all:all src.jpg This command performs exactly the same task as the command above, except that the -o option will not write to an output file that already exists.
exiftool -b -jpgfromraw -w %d%f_%ue.jpg -execute -b -previewimage -w %d%f_%ue.jpg -execute -tagsfromfile @ -srcfile %d%f_%ue.jpg -overwrite_original -common_args --ext jpg DIR [Advanced] Extract JpgFromRaw or PreviewImage from all but JPG files in DIR, saving them with file names like "image_EXT.jpg", then add all meta information from the original files to the extracted images.  Here, the command line is broken into three sections (separated by -execute options), and each is executed as if it were a separate command.  The -common_args option causes the "--ext jpg DIR" arguments to be applied to all three commands, and the -srcfile option allows the extracted JPG image to be the source file for the third command (whereas the RAW files are the source files for the other two commands).
By writing the "FileName" and "Directory" tags, files are renamed and/or moved to new directories.  This can be particularly useful and powerful for organizing files by date when combined with the -d option.  New directories are created as necessary, but existing files will not be overwritten.  The format codes %d, %f and %e may be used in the new file name to represent the directory, name and extension of the original file, and %c may be used to add a copy number if the file already exists (see the -w option for details).  Note that if used within a date format string, an extra '%' must be added to pass these codes through the date/time parser.  (And further note that in a Windows batch file, all '%' characters must also be escaped, so in this extreme case '%%%%f' is necessary to pass a simple '%f' through the two levels of parsing.)  See <https://exiftool.org/filename.html> for additional documentation and examples.
exiftool -filename=new.jpg dir/old.jpg Rename "old.jpg" to "new.jpg" in directory "dir".
exiftool -directory=%e dir Move all files from directory "dir" into directories named by the original file extensions.
exiftool '-Directory<DateTimeOriginal' -d %Y/%m/%d dir Move all files in "dir" into a directory hierarchy based on year, month and day of "DateTimeOriginal".  eg) This command would move the file "dir/image.jpg" with a "DateTimeOriginal" of "2005:10:12 16:05:56" to "2005/10/12/image.jpg".
exiftool -o . '-Directory<DateTimeOriginal' -d %Y/%m/%d dir Same effect as above except files are copied instead of moved.
exiftool '-filename<%f_${model;}.%e' dir Rename all files in "dir" by adding the camera model name to the file name.  The semicolon after the tag name inside the braces causes characters which are invalid in Windows file names to be deleted from the tag value (see the "Advanced formatting feature" for an explanation).
exiftool '-FileName<CreateDate' -d %Y%m%d_%H%M%S%%-c.%%e dir Rename all images in "dir" according to the "CreateDate" date and time, adding a copy number with leading '-' if the file already exists ("%-c"), and preserving the original file extension (%e). Note the extra '%' necessary to escape the filename codes (%c and %e) in the date format string.
exiftool -r '-FileName<CreateDate' -d %Y-%m-%d/%H%M_%%f.%%e dir Both the directory and the filename may be changed together via the "FileName" tag if the new "FileName" contains a '/'.  The example above recursively renames all images in a directory by adding a "CreateDate" timestamp to the start of the filename, then moves them into new directories named by date.
exiftool '-FileName<${CreateDate}_$filenumber.jpg' -d %Y%m%d -ext jpg . Set the filename of all JPG images in the current directory from the CreateDate and FileNumber tags, in the form "20060507_118-1861.jpg".
ExifTool implements geotagging via 3 special tags: Geotag (which for convenience is also implemented as an exiftool option), Geosync and Geotime.  The examples below highlight some geotagging features.  See <https://exiftool.org/geotag.html> for additional documentation.
exiftool -geotag track.log a.jpg Geotag an image ("a.jpg") from position information in a GPS track log ("track.log").  Since the "Geotime" tag is not specified, the value of DateTimeOriginal is used for geotagging.  Local system time is assumed unless DateTimeOriginal contains a timezone.
exiftool -geotag t.log -geotime='2009:04:02 13:41:12-05:00' a.jpg Geotag an image with the GPS position for a specific time.
exiftool -geotag log.gpx '-xmp:geotime<createdate' dir Geotag all images in directory "dir" with XMP tags instead of EXIF tags, based on the image CreateDate.
exiftool -geotag a.log -geosync=-20 dir Geotag images in directory "dir", accounting for image timestamps which were 20 seconds ahead of GPS.
exiftool -geotag a.log -geosync=1.jpg -geosync=2.jpg dir Geotag images using time synchronization from two previously geotagged images (1.jpg and 2.jpg), synchronizing the image and GPS times using a linear time drift correction.
exiftool -geotag a.log '-geotime<${createdate}+01:00' dir Geotag images in "dir" using CreateDate with the specified timezone. If CreateDate already contained a timezone, then the timezone specified on the command line is ignored.
exiftool -geotag= a.jpg Delete GPS tags which may have been added by the geotag feature. Note that this does not remove all GPS tags -- to do this instead use "-gps:all=".
exiftool -xmp:geotag= a.jpg Delete XMP GPS tags which were added by the geotag feature.
exiftool -xmp:geotag=track.log a.jpg Geotag an image with XMP tags, using the time from DateTimeOriginal.
exiftool -geotag a.log -geotag b.log -r dir Combine multiple track logs and geotag an entire directory tree of images.
exiftool -geotag 'tracks/*.log' -r dir Read all track logs from the "tracks" directory.
exiftool -p gpx.fmt -d %Y-%m-%dT%H:%M:%SZ dir > out.gpx Generate a GPX track log from all images in directory "dir".  This example uses the "gpx.fmt" file included in the full ExifTool distribution package and assumes that the images in "dir" have all been previously geotagged.
cat a.jpg | exiftool - Extract information from stdin.
exiftool image.jpg -thumbnailimage -b | exiftool - Extract information from an embedded thumbnail image.
cat a.jpg | exiftool -iptc:keywords+=fantastic - > b.jpg Add an IPTC keyword in a pipeline, saving output to a new file.
curl -s http://a.domain.com/bigfile.jpg | exiftool -fast - Extract information from an image over the internet using the cURL utility.  The -fast option prevents exiftool from scanning for trailer information, so only the meta information header is transferred.
exiftool a.jpg -thumbnailimage -b | exiftool -comment=wow - | exiftool a.jpg -thumbnailimage'<=-' Add a comment to an embedded thumbnail image.  (Why anyone would want to do this I don't know, but I've included this as an example to illustrate the flexibility of ExifTool.)
Interrupting exiftool with a CTRL-C or SIGINT will not result in partially written files or temporary files remaining on the hard disk. The exiftool application traps SIGINT and defers it until the end of critical processes if necessary, then does a proper cleanup before exiting.
The exiftool application exits with a status of 0 on success, or 1 if an error occurred, or 2 if all files failed the -if condition (for any of the commands if -execute was used).
Copyright 2003-2021, Phil Harvey
This is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Image::ExifTool(3pm), Image::ExifTool::TagNames(3pm), Image::ExifTool::Shortcuts(3pm), Image::ExifTool::Shift.pl
CARP(4)                   BSD Kernel Interfaces Manual                   CARP(4)
carp — Common Address Redundancy Protocol
device carp
The CARP allows multiple hosts on the same local network to share a set of IPv4 and/or IPv6 addresses.  Its primary purpose is to ensure that these addresses are always available.
To use carp, the administrator needs to configure at a minimum a common virtual host ID (vhid), and attach at least one IP address to this vhid on each machine which is to take part in the virtual group.  Additional parameters can also be set on a per-vhid basis: advbase and advskew, which are used to control how frequently the host sends advertisements when it is the master for a virtual host, and pass which is used to authenticate carp advertisements.  The advbase parameter stands for “advertisement base”.  It is measured in seconds and specifies the base of the advertisement interval.  The advskew parameter stands for “advertisement skew”.  It is measured in 1/256 of seconds.  It is added to the base advertisement interval to make one host advertise a bit slower that the other does.  Both advbase and advskew are put inside CARP advertisements.  These values can be configured using ifconfig(8), or through the SIOCSVH ioctl(2).
CARP virtual hosts can be configured on multicast-capable interfaces: Ethernet, layer 2 VLAN, FDDI and Token Ring.  An arbitrary number of virtual host IDs can be configured on an interface.  An arbitrary number of IPv4 or IPv6 addresses can be attached to a particular vhid.  It is important that all hosts participating in a vhid have the same list of prefixes configured on the vhid, since all the prefixes are included in the cryptographic checksum supplied in each advertisement.  Multiple vhids running on one interface participate in master/backup elections independently.
Additionally, there are a number of global parameters which can be set using sysctl(8):
net.inet.carp.allow                   Allow carp operation.  When disabled, virtual hosts remain in initial state, neither sending nor receiving announcements or traffic.  Enabled by default.
net.inet.carp.preempt                 Allow virtual hosts to preempt each other.  When enabled, a vhid in a backup state would preempt a master that is announcing itself with a lower advskew.  Disabled by default.
net.inet.carp.dscp                    DSCP value in carp packet.  Valid Values are 0 to 63.  A value of 4 is equivalent to the old standard of TOS LOW_DELAY.  TOS values were deprecated and replaced by DSCP in 1998.  The default value is 56 (CS7/Network Control).
net.inet.carp.log                     Determines what events relating to carp vhids are logged.  A value of 0 disables any logging.  A value of 1 enables logging state changes of carp vhids.  Values above 1 enable logging of bad carp packets.  The default value is 1.
net.inet.carp.demotion                This value shows the current level of CARP demotion.  The value is added to the actual advskew sent in announcements for all vhids.  During normal system operation the demotion factor is zero.  However, problematic conditions raise its level: when carp experiences problem with sending announcements, when an interface running a vhid goes down, or while the pfsync(4) interface is not synchronized.  The demotion factor can be adjusted writing to the sysctl oid.  The signed value supplied to the sysctl(8) command is added to current demotion factor.  This allows to control carp behaviour depending on some external conditions, for example on the status of some daemon utility.
net.inet.carp.ifdown_demotion_factor  This value is added to net.inet.carp.demotion when an interface running a vhid goes down. The default value is 240 (the maximum advskew value).
net.inet.carp.senderr_demotion_factor This value is added to net.inet.carp.demotion when carp experiences errors sending its announcements.  The default value is 240 (the maximum advskew value).
Sometimes it is useful to get notified about carp status change events. This can be accomplished by using devd(8) hooks.  Master/slave events are signalled under system CARP.  The subsystem specifies the vhid and name of the interface where the master/slave event occurred.  The type of the message displays the new state of the vhid.  Please see devd.conf(5) and the EXAMPLES section for more information.
For firewalls and routers with multiple interfaces, it is desirable to failover all of the addresses running carp together, when one of the physical interfaces goes down.  This is achieved by the use of the preempt option.  Enable it on both hosts A and B:
sysctl net.inet.carp.preempt=1
Assume that host A is the preferred master and we are running the 192.168.1.0/24 prefix on em0 and 192.168.2.0/24 on em1.  This is the setup for host A (advskew is above 0 so it could be overwritten in the emergency situation from the other host):
ifconfig em0 vhid 1 advskew 100 pass mekmitasdigoat 192.168.1.1/24 ifconfig em1 vhid 2 advskew 100 pass mekmitasdigoat 192.168.2.1/24
The setup for host B is identical, but it has a higher advskew:
ifconfig em0 vhid 1 advskew 200 pass mekmitasdigoat 192.168.1.1/24 ifconfig em1 vhid 2 advskew 200 pass mekmitasdigoat 192.168.2.1/24
When one of the physical interfaces of host A fails, advskew is demoted to a configured value on all its carp vhids.  Due to the preempt option, host B would start announcing itself, and thus preempt host A on both interfaces instead of just the failed one.
Processing of carp status change events can be set up by using the following devd.conf rule:
notify 0 { match "system"          "CARP"; match "subsystem"       "[0-9]+@[0-9a-z]+"; match "type"            "(MASTER|BACKUP)"; action "/root/carpcontrol.sh $subsystem $type"; };
To see carp packets decoded in tcpdump(1) output, one needs to specify the -T carp option, otherwise tcpdump(1) will interpret them as VRRP packets:
tcpdump -npi vlan0 -T carp
tcpdump(1), inet(4), pfsync(4), devd.conf(5), rc.conf(5), ifconfig(8), sysctl(8)
The carp device first appeared in OpenBSD 3.5.  The carp device was imported into FreeBSD 5.4.  In FreeBSD 10.0, carp was significantly rewritten, and is no longer a pseudo-interface.
GIT-UPDATE-REF(1)                  Git Manual                  GIT-UPDATE-REF(1)
git-update-ref - Update the object name stored in a ref safely
git update-ref [-m <reason>] [--no-deref] (-d <ref> [<oldvalue>] | [--create-reflog] <ref> <newvalue> [<oldvalue>] | --stdin [-z])
Given two arguments, stores the <newvalue> in the <ref>, possibly dereferencing the symbolic refs. E.g. git update-ref HEAD <newvalue> updates the current branch head to the new object.
Given three arguments, stores the <newvalue> in the <ref>, possibly dereferencing the symbolic refs, after verifying that the current value of the <ref> matches <oldvalue>. E.g. git update-ref refs/heads/master <newvalue> <oldvalue> updates the master branch head to <newvalue> only if its current value is <oldvalue>. You can specify 40 "0" or an empty string as <oldvalue> to make sure that the ref you are creating does not exist.
It also allows a "ref" file to be a symbolic pointer to another ref file by starting with the four-byte header sequence of "ref:".
More importantly, it allows the update of a ref file to follow these symbolic pointers, whether they are symlinks or these "regular file symbolic refs". It follows real symlinks only if they start with "refs/": otherwise it will just try to read them and update them as a regular file (i.e. it will allow the filesystem to follow them, but will overwrite such a symlink to somewhere else with a regular filename).
If --no-deref is given, <ref> itself is overwritten, rather than the result of following the symbolic pointers.
In general, using
git update-ref HEAD "$head"
should be a lot safer than doing
echo "$head" > "$GIT_DIR/HEAD"
both from a symlink following standpoint and an error checking standpoint. The "refs/" rule for symlinks means that symlinks that point to "outside" the tree are safe: they’ll be followed for reading but not for writing (so we’ll never write through a ref symlink to some other tree, if you have copied a whole archive by creating a symlink tree).
With -d flag, it deletes the named <ref> after verifying it still contains <oldvalue>.
With --stdin, update-ref reads instructions from standard input and performs all modifications together. Specify commands of the form:
update SP <ref> SP <newvalue> [SP <oldvalue>] LF create SP <ref> SP <newvalue> LF delete SP <ref> [SP <oldvalue>] LF verify SP <ref> [SP <oldvalue>] LF option SP <opt> LF start LF prepare LF commit LF abort LF
With --create-reflog, update-ref will create a reflog for each ref even if one would not ordinarily be created.
Quote fields containing whitespace as if they were strings in C source code; i.e., surrounded by double-quotes and with backslash escapes. Use 40 "0" characters or the empty string to specify a zero value. To specify a missing value, omit the value and its preceding SP entirely.
Alternatively, use -z to specify in NUL-terminated format, without quoting:
update SP <ref> NUL <newvalue> NUL [<oldvalue>] NUL create SP <ref> NUL <newvalue> NUL delete SP <ref> NUL [<oldvalue>] NUL verify SP <ref> NUL [<oldvalue>] NUL option SP <opt> NUL start NUL prepare NUL commit NUL abort NUL
In this format, use 40 "0" to specify a zero value, and use the empty string to specify a missing value.
In either format, values can be specified in any form that Git recognizes as an object name. Commands in any other format or a repeated <ref> produce an error. Command meanings are:
update Set <ref> to <newvalue> after verifying <oldvalue>, if given. Specify a zero <newvalue> to ensure the ref does not exist after the update and/or a zero <oldvalue> to make sure the ref does not exist before the update.
create Create <ref> with <newvalue> after verifying it does not exist. The given <newvalue> may not be zero.
delete Delete <ref> after verifying it exists with <oldvalue>, if given. If given, <oldvalue> may not be zero.
verify Verify <ref> against <oldvalue> but do not change it. If <oldvalue> is zero or missing, the ref must not exist.
option Modify behavior of the next command naming a <ref>. The only valid option is no-deref to avoid dereferencing a symbolic ref.
start Start a transaction. In contrast to a non-transactional session, a transaction will automatically abort if the session ends without an explicit commit. This command may create a new empty transaction when the current one has been committed or aborted already.
prepare Prepare to commit the transaction. This will create lock files for all queued reference updates. If one reference could not be locked, the transaction will be aborted.
commit Commit all reference updates queued for the transaction, ending the transaction.
abort Abort the transaction, releasing all locks if the transaction is in prepared state.
If all <ref>s can be locked with matching <oldvalue>s simultaneously, all modifications are performed. Otherwise, no modifications are performed. Note that while each individual <ref> is updated or deleted atomically, a concurrent reader may still see a subset of the modifications.
If config parameter "core.logAllRefUpdates" is true and the ref is one under "refs/heads/", "refs/remotes/", "refs/notes/", or a pseudoref like HEAD or ORIG_HEAD; or the file "$GIT_DIR/logs/<ref>" exists then git update-ref will append a line to the log file "$GIT_DIR/logs/<ref>" (dereferencing all symbolic refs before creating the log name) describing the change in ref value. Log lines are formatted as:
oldsha1 SP newsha1 SP committer LF