neulab/tldr huggingface dataset:
-g[NUM][:NUM...] (-groupHeadings) Organize output by tag group.  NUM specifies a group family number, and may be 0 (general location), 1 (specific location), 2 (category), 3 (document number), 4 (instance number), 5 (metadata path), 6 (EXIF/TIFF format) or 7 (tag ID).  -g0 is assumed if a family number is not specified.  May be combined with other options to add group names to the output.  Multiple families may be specified by separating them with colons.  By default the resulting group name is simplified by removing any leading "Main:" and collapsing adjacent identical group names, but this can be avoided by placing a colon before the first family number (eg. -g:3:1).  Use the -listg option to list group names for a specified family.  The SavePath and SaveFormat API options are automatically enabled if the respective family 5 or 6 group names are requested.  See the API GetGroup documentation for more information.
-G[NUM][:NUM...] (-groupNames) Same as -g but print group name for each tag.  -G0 is assumed if NUM is not specified.  May be combined with a number of other options to add group names to the output.  Note that NUM may be added wherever -G is mentioned in the documentation.  See the -g option above for details.
-h (-htmlFormat) Use HTML table formatting for output.  Implies the -E option.  The formatting options -D, -H, -g, -G, -l and -s may be used in combination with -h to influence the HTML format.
-H (-hex) Show tag ID number in hexadecimal when extracting information.
-htmlDump[OFFSET] Generate a dynamic web page containing a hex dump of the EXIF information.  This can be a very powerful tool for low-level analysis of EXIF information.  The -htmlDump option is also invoked if the -v and -h options are used together.  The verbose level controls the maximum length of the blocks dumped.  An OFFSET may be given to specify the base for displayed offsets.  If not provided, the EXIF/TIFF base offset is used.  Use -htmlDump0 for absolute offsets.  Currently only EXIF/TIFF and JPEG information is dumped, but the -u option can be used to give a raw hex dump of other file formats.
-j[[+]=JSONFILE] (-json) Use JSON (JavaScript Object Notation) formatting for console output, or import JSON file if JSONFILE is specified.  This option may be combined with -g to organize the output into objects by group, or -G to add group names to each tag.  List-type tags with multiple items are output as JSON arrays unless -sep is used.  By default XMP structures are flattened into individual tags in the JSON output, but the original structure may be preserved with the -struct option (this also causes all list-type XMP tags to be output as JSON arrays, otherwise single-item lists would be output as simple strings).  The -a option is implied when -json is used, but entries with identical JSON names are suppressed in the output.  (-G4 may be used to ensure that all tags have unique JSON names.)  Adding the -D or -H option changes tag values to JSON objects with "val" and "id" fields, and adding -l adds a "desc" field, and a "num" field if the numerical value is different from the converted "val".  The -b option may be added to output binary data, encoded in base64 if necessary (indicated by ASCII "base64:" as the first 7 bytes of the value), and -t may be added to include tag table information (see -t for details).  The JSON output is UTF-8 regardless of any -L or -charset option setting, but the UTF-8 validation is disabled if a character set other than UTF-8 is specified.
If JSONFILE is specified, the file is imported and the tag definitions from the file are used to set tag values on a per-file basis.  The special "SourceFile" entry in each JSON object associates the information with a specific target file.  An object with a missing SourceFile or a SourceFile of "*" defines default tags for all target files which are combined with any tags specified for the specific SourceFile processed.  The imported JSON file must have the same format as the exported JSON files with the exception that the -g option is not compatible with the import file format (use -G instead).  Additionally, tag names in the input JSON file may be suffixed with a "#" to disable print conversion.
Unlike CSV import, empty values are not ignored, and will cause an empty value to be written if supported by the specific metadata type.  Tags are deleted by using the -f option and setting the tag value to "-" (or to the MissingTagValue setting if this API option was used).  Importing with -j+=JSONFILE causes new values to be added to existing lists.
-l (-long) Use long 2-line Canon-style output format.  Adds a description and unconverted value (if it is different from the converted value) to the XML, JSON or PHP output when -X, -j or -php is used.  May also be combined with -listf, -listr or -listwf to add descriptions of the file types.
-L (-latin) Use Windows Latin1 encoding (cp1252) for output tag values instead of the default UTF-8.  When writing, -L specifies that input text values are Latin1 instead of UTF-8.  Equivalent to "-charset latin".
-lang [LANG] Set current language for tag descriptions and converted values. LANG is "de", "fr", "ja", etc.  Use -lang with no other arguments to get a list of available languages.  The default language is "en" if -lang is not specified.  Note that tag/group names are always English, independent of the -lang setting, and translation of warning/error messages has not yet been implemented.  May also be combined with -listx to output descriptions in one language only.
By default, ExifTool uses UTF-8 encoding for special characters, but the the -L or -charset option may be used to invoke other encodings. Note that ExifTool uses Unicode::LineBreak if available to help preserve the column alignment of the plain text output for languages with a variable-width character set.
Currently, the language support is not complete, but users are welcome to help improve this by submitting their own translations. To submit a translation, follow these steps (you must have Perl installed for this):
1. Download and unpack the latest Image-ExifTool full distribution.
2. 'cd' into the Image-ExifTool directory.
3. Run this command to make an XML file of the desired tags (eg. EXIF):
./exiftool -listx -exif:all > out.xml
4. Copy this text into a file called 'import.pl' in the exiftool directory:
push @INC, 'lib'; require Image::ExifTool::TagInfoXML; my $file = shift or die "Expected XML file name\n"; $Image::ExifTool::TagInfoXML::makeMissing = shift; Image::ExifTool::TagInfoXML::BuildLangModules($file,8);
5. Run the 'import.pl' script to Import the XML file, generating the 'MISSING' entries for your language (eg. Russian):
perl import.pl out.xml ru
6. Edit the generated language module lib/Image/ExifTool/Lang/ru.pm, and search and replace all 'MISSING' strings in the file with your translations.
7. Email the module ('ru.pm' in this example) to philharvey66 at gmail.com
8. Thank you!!
-listItem INDEX For list-type tags, this causes only the item with the specified index to be extracted.  INDEX is 0 for the first item in the list. Negative indices may also be used to reference items from the end of the list.  Has no effect on single-valued tags.  Also applies to tag values when copying from a tag, and in -if conditions.
-n (--printConv) Disable print conversion for all tags.  By default, extracted values are converted to a more human-readable format, but the -n option disables this conversion, revealing the machine-readable values. For example:
> exiftool -Orientation -S a.jpg Orientation: Rotate 90 CW > exiftool -Orientation -S -n a.jpg Orientation: 6
The print conversion may also be disabled on a per-tag basis by suffixing the tag name with a "#" character:
> exiftool -Orientation# -Orientation -S a.jpg Orientation: 6 Orientation: Rotate 90 CW
These techniques may also be used to disable the inverse print conversion when writing.  For example, the following commands all have the same effect:
> exiftool -Orientation='Rotate 90 CW' a.jpg > exiftool -Orientation=6 -n a.jpg > exiftool -Orientation#=6 a.jpg
-p FMTFILE or STR (-printFormat) Print output in the format specified by the given file or string. The argument is interpreted as a string unless a file of that name exists, in which case the string is loaded from the contents of the file.  Tag names in the format file or string begin with a "$" symbol and may contain leading group names and/or a trailing "#" (to disable print conversion).  Case is not significant.  Braces "{}" may be used around the tag name to separate it from subsequent text. Use $$ to represent a "$" symbol, and $/ for a newline.
Multiple -p options may be used, each contributing a line (or more) of text to the output.  Lines beginning with "#[HEAD]" and "#[TAIL]" are output before the first processed file and after the last processed file respectively.  Lines beginning with "#[SECT]" and "#[ENDS]" are output before and after each section of files.  A section is defined as a group of consecutive files with the same section header (eg. files are grouped by directory if "#[SECT]" contains $directory).  Lines beginning with "#[BODY]" and lines not beginning with "#" are output for each processed file.  Lines beginning with "#[IF]" are not output, but all BODY lines are skipped if any tag on an IF line doesn't exist.  Other lines beginning with "#" are ignored.  For example, this format file:
# this is a comment line #[HEAD]-- Generated by ExifTool $exifToolVersion -- File: $FileName - $DateTimeOriginal (f/$Aperture, ${ShutterSpeed}s, ISO $EXIF:ISO) #[TAIL]-- end --
with this command:
exiftool -p test.fmt a.jpg b.jpg
produces output like this:
-- Generated by ExifTool 12.30 -- File: a.jpg - 2003:10:31 15:44:19 (f/5.6, 1/60s, ISO 100) File: b.jpg - 2006:05:23 11:57:38 (f/8.0, 1/13s, ISO 100) -- end --
The values of List-type tags with multiple items and Shortcut tags representing multiple tags are joined according the the -sep option setting when interpolated in the string.
When -ee (-extractEmbedded) is combined with -p, embedded documents are effectively processed as separate input files.
If a specified tag does not exist, a minor warning is issued and the line with the missing tag is not printed.  However, the -f option may be used to set the value of missing tags to '-' (but this may be configured via the MissingTagValue API option), or the -m option may be used to ignore minor warnings and leave the missing values empty. Alternatively, -q -q may be used to simply suppress the warning messages.
The "Advanced formatting feature" may be used to modify the values of individual tags with the -p option.
-php Format output as a PHP Array.  The -g, -G, -D, -H, -l, -sep and -struct options combine with -php, and duplicate tags are handled in the same way as with the -json option.  As well, the -b option may be added to output binary data, and -t may be added to include tag table information (see -t for details).  Here is a simple example showing how this could be used in a PHP script:
<?php eval('$array=' . `exiftool -php -q image.jpg`); print_r($array); ?>
-s[NUM] (-short) Short output format.  Prints tag names instead of descriptions.  Add NUM or up to 3 -s options for even shorter formats:
-s1 or -s        - print tag names instead of descriptions -s2 or -s -s     - no extra spaces to column-align values -s3 or -s -s -s  - print values only (no tag names)
Also effective when combined with -t, -h, -X or -listx options.
-S (-veryShort) Very short format.  The same as -s2 or two -s options.  Tag names are printed instead of descriptions, and no extra spaces are added to column-align values.
-sep STR (-separator) Specify separator string for items in list-type tags.  When reading, the default is to join list items with ", ".  When writing, this option causes values assigned to list-type tags to be split into individual items at each substring matching STR (otherwise they are not split by default).  Space characters in STR match zero or more whitespace characters in the value.
Note that an empty separator ("") is allowed, and will join items with no separator when reading, or split the value into individual characters when writing.
For pure binary output (-b used without -j, -php or -X), the first -sep option specifies a list-item separator, and a second -sep option specifies a terminator for the end of the list (or after each value if not a list).  In these strings, "\n", "\r" and "\t" may be used to represent a newline, carriage return and tab respectively. By default, binary list items are separated by a newline, and no terminator is added.
-sort, --sort Sort output by tag description, or by tag name if the -s option is used.  When sorting by description, the sort order will depend on the -lang option setting.  Without the -sort option, tags appear in the order they were specified on the command line, or if not specified, the order they were extracted from the file.  By default, tags are organized by groups when combined with the -g or -G option, but this grouping may be disabled with --sort.
-struct, --struct Output structured XMP information instead of flattening to individual tags.  This option works well when combined with the XML (-X) and JSON (-j) output formats.  For other output formats, XMP structures and lists are serialized into the same format as when writing structured information (see <https://exiftool.org/struct.html> for details).  When copying, structured tags are copied by default unless --struct is used to disable this feature (although flattened tags may still be copied by specifying them individually unless -struct is used).  These options have no effect when assigning new values since both flattened and structured tags may always be used when writing.
-t (-tab) Output a tab-delimited list of description/values (useful for database import).  May be combined with -s to print tag names instead of descriptions, or -S to print tag values only, tab- delimited on a single line.  The -t option may be combined with -j, -php or -X to add tag table information ("table", tag "id", and "index" for cases where multiple conditional tags exist with the same ID).
-T (-table) Output tag values in table form.  Equivalent to -t -S -q -f.
-v[NUM] (-verbose) Print verbose messages.  NUM specifies the level of verbosity in the range 0-5, with higher numbers being more verbose.  If NUM is not given, then each -v option increases the level of verbosity by 1. With any level greater than 0, most other options are ignored and normal console output is suppressed unless specific tags are extracted.  Using -v0 causes the console output buffer to be flushed after each line (which may be useful to avoid delays when piping exiftool output), and prints the name of each processed file when writing.  Also see the -progress option.
-w[+|!] EXT or FMT (-textOut) Write console output to files with names ending in EXT, one for each source file.  The output file name is obtained by replacing the source file extension (including the '.') with the specified extension (and a '.' is added to the start of EXT if it doesn't already contain one).  Alternatively, a FMT string may be used to give more control over the output file name and directory.  In the format string, %d, %f and %e represent the directory, filename and extension of the source file, and %c represents a copy number which is automatically incremented if the file already exists.  %d includes the trailing '/' if necessary, but %e does not include the leading '.'.  For example:
-w %d%f.txt       # same effect as "-w txt" -w dir/%f_%e.out  # write files to "dir" as "FILE_EXT.out" -w dir2/%d%f.txt  # write to "dir2", keeping dir structure -w a%c.txt        # write to "a.txt" or "a1.txt" or "a2.txt"...
Existing files will not be changed unless an exclamation point is added to the option name (ie. -w! or -textOut!) to overwrite the file, or a plus sign (ie. -w+ or -textOut+) to append to the existing file.  Both may be used (ie. -w+! or -textOut+!) to overwrite output files that didn't exist before the command was run, and append the output from multiple source files.  For example, to write one output file for all source files in each directory:
exiftool -filename -createdate -T -w+! %d/out.txt -r DIR
Capitalized format codes %D, %F, %E and %C provide slightly different alternatives to the lower case versions.  %D does not include the trailing '/', %F is the full filename including extension, %E includes the leading '.', and %C increments the count for each processed file (see below).
1) In a Windows BAT file the "%" character is represented by "%%", so an argument like "%d%f.txt" is written as "%%d%%f.txt".
2) If the argument for -w does not contain a valid format code (eg. %f), then it is interpreted as a file extension, but there are three different ways to create a single output file from multiple source files:
# 1. Shell redirection exiftool FILE1 FILE2 ... > out.txt
# 2. With the -w option and a zero-width format code exiftool -w+! %0fout.txt FILE1 FILE2 ...
# 3. With the -W option (see the -W option below) exiftool -W+! out.txt FILE1 FILE2 ...
Advanced features:
A substring of the original file name, directory or extension may be taken by specifying a field width immediately following the '%' character.  If the width is negative, the substring is taken from the end.  The substring position (characters to ignore at the start or end of the string) may be given by a second optional value after a decimal point.  For example:
Input File Name     Format Specifier    Output File Name ----------------    ----------------    ---------------- Picture-123.jpg     %7f.txt             Picture.txt Picture-123.jpg     %-.4f.out           Picture.out Picture-123.jpg     %7f.%-3f            Picture.123 Picture-123a.jpg    Meta%-3.1f.txt      Meta123.txt
(Note that special characters may have a width of greater than one.)
For %d and %D, the field width/position specifiers may be applied to the directory levels instead of substring position by using a colon instead of a decimal point in the format specifier.  For example:
Source Dir     Format   Result       Notes ------------   ------   ----------   ------------------ pics/2012/02   %2:d     pics/2012/   take top 2 levels pics/2012/02   %-:1d    pics/2012/   up one directory level pics/2012/02   %:1d     2012/02/     ignore top level pics/2012/02   %1:1d    2012/        take 1 level after top pics/2012/02   %-1:D    02           bottom level folder name /Users/phil    %:2d     phil/        ignore top 2 levels
(Note that the root directory counts as one level when an absolute path is used as in the last example above.)
For %c, these modifiers have a different effects.  If a field width is given, the copy number is padded with zeros to the specified width.  A leading '-' adds a dash before the copy number, and a '+' adds an underline.  By default, the copy number is omitted from the first file of a given name, but this can be changed by adding a decimal point to the modifier.  For example:
-w A%-cZ.txt      # AZ.txt, A-1Z.txt, A-2Z.txt ... -w B%5c.txt       # B.txt, B00001.txt, B00002.txt ... -w C%.c.txt       # C0.txt, C1.txt, C2.txt ... -w D%-.c.txt      # D-0.txt, D-1.txt, D-2.txt ... -w E%-.4c.txt     # E-0000.txt, E-0001.txt, E-0002.txt ... -w F%-.4nc.txt    # F-0001.txt, F-0002.txt, F-0003.txt ... -w G%+c.txt       # G.txt, G_1.txt G_2.txt ... -w H%-lc.txt      # H.txt, H-b.txt, H-c.txt ... -w I.%.3uc.txt    # I.AAA.txt, I.AAB.txt, I.AAC.txt ...
A special feature allows the copy number to be incremented for each processed file by using %C (upper case) instead of %c.  This allows a sequential number to be added to output file names, even if the names are different.  For %C, a copy number of zero is not omitted as it is with %c.  A leading '-' causes the number to be reset at the start of each new directory, and '+' has no effect.  The number before the decimal place gives the starting index, the number after the decimal place gives the field width.  The following examples show the output filenames when used with the command "exiftool rose.jpg star.jpg jet.jpg ...":
-w %C%f.txt       # 0rose.txt, 1star.txt, 2jet.txt -w %f-%10C.txt    # rose-10.txt, star-11.txt, jet-12.txt -w %.3C-%f.txt    # 000-rose.txt, 001-star.txt, 002-jet.txt -w %57.4C%f.txt   # 0057rose.txt, 0058star.txt, 0059jet.txt
All format codes may be modified by 'l' or 'u' to specify lower or upper case respectively (ie. %le for a lower case file extension). When used to modify %c or %C, the numbers are changed to an alphabetical base (see example H above).  Also, %c and %C may be modified by 'n' to count using natural numbers starting from 1, instead of 0 (see example F above).
This same FMT syntax is used with the -o and -tagsFromFile options, although %c and %C are only valid for output file names.
-W[+|!] FMT (-tagOut) This enhanced version of the -w option allows a separate output file to be created for each extracted tag.  See the -w option documentation above for details of the basic functionality.  Listed here are the differences between -W and -w:
1) With -W, a new output file is created for each extracted tag.
2) -W supports three additional format codes:  %t, %g and %s represent the tag name, group name, and suggested extension for the output file (based on the format of the data).  The %g code may be followed by a single digit to specify the group family number (eg. %g1), otherwise family 0 is assumed.  The substring width/position/case specifiers may be used with these format codes in exactly the same way as with %f and %e.
3) The argument for -W is interpreted as a file name if it contains no format codes.  (For -w, this would be a file extension.)  This change allows a simple file name to be specified, which, when combined with the append feature, provides a method to write metadata from multiple source files to a single output file without the need for shell redirection.  For example, the following pairs of commands give the same result:
# overwriting existing text file exiftool test.jpg > out.txt     # shell redirection exiftool test.jpg -W+! out.txt  # equivalent -W option
# append to existing text file exiftool test.jpg >> out.txt    # shell redirection exiftool test.jpg -W+ out.txt   # equivalent -W option
4) Adding the -v option to -W sends a list of the tags and output file names to the console instead of giving a verbose dump of the entire file.  (Unless appending all output to one file for each source file by using -W+ with an output file FMT that does not contain %t, $g or %s.)
5) Individual list items are stored in separate files when -W is combined with -b, but note that for separate files to be created %c or %C must be used in FMT to give the files unique names.
-Wext EXT, --Wext EXT (-tagOutExt) This option is used to specify the type of output file(s) written by the -W option.  An output file is written only if the suggested extension matches EXT.  Multiple -Wext options may be used to write more than one type of file.  Use --Wext to write all but the specified type(s).
-X (-xmlFormat) Use ExifTool-specific RDF/XML formatting for console output. Implies the -a option, so duplicate tags are extracted.  The formatting options -b, -D, -H, -l, -s, -sep, -struct and -t may be used in combination with -X to affect the output, but note that the tag ID (-D, -H and -t), binary data (-b) and structured output (-struct) options are not effective for the short output (-s). Another restriction of -s is that only one tag with a given group and name may appear in the output.  Note that the tag ID options (-D, -H and -t) will produce non-standard RDF/XML unless the -l option is also used.
By default, -X outputs flattened tags, so -struct should be added if required to preserve XMP structures.  List-type tags with multiple values are formatted as an RDF Bag, but they are combined into a single string when -s or -sep is used.  Using -L changes the XML encoding from "UTF-8" to "windows-1252".  Other -charset settings change the encoding only if there is a corresponding standard XML character set.  The -b option causes binary data values to be written, encoded in base64 if necessary.  The -t option adds tag table information to the output (see -t for details).
Note:  This output is NOT the same as XMP because it uses dynamically-generated property names corresponding to the ExifTool tag names, and not the standard XMP properties.  To write XMP instead, use the -o option with an XMP extension for the output file.
-a, --a (-duplicates, --duplicates) Allow (-a) or suppress (--a) duplicate tag names to be extracted. By default, duplicate tags are suppressed when reading unless the -ee or -X options are used or the Duplicates option is enabled in the configuration file. This option has an affect when writing only to allow duplicate Warning messages to be shown.  Duplicate tags are always extracted when copying.
-e (--composite) Extract existing tags only -- don't generate composite tags.
-ee[NUM] (-extractEmbedded) Extract information from embedded documents in EPS files, embedded EPS information and JPEG and Jpeg2000 images in PDF files, embedded MPF images in JPEG and MPO files, streaming metadata in AVCHD videos, and the resource fork of Mac OS files.  Implies the -a option.  Use -g3 or -G3 to identify the originating document for extracted information.  Embedded documents containing sub-documents are indicated with dashes in the family 3 group name.  (eg. "Doc2-3" is the 3rd sub-document of the 2nd embedded document.) Note that this option may increase processing time substantially, especially for PDF files with many embedded images or videos with streaming metadata.
When used with -ee, the -p option is evaluated for each embedded document as if it were a separate input file.  This allows, for example, generation of GPS track logs from timed metadata in videos. See <https://exiftool.org/geotag.html#Inverse> for examples.
Setting NUM to 2 causes the H264 video stream in MP4 videos to be parsed until the first Supplemental Enhancement Information (SEI) message is decoded, or 3 to parse the entire H624 stream and decode all SEI information.  For M2TS videos, a setting of 3 causes the entire file to be parsed in search of unlisted programs which may contain timed GPS.
-ext[+] EXT, --ext EXT (-extension) Process only files with (-ext) or without (--ext) a specified extension.  There may be multiple -ext and --ext options.  A plus sign may be added (ie. -ext+) to add the specified extension to the normally processed files.  EXT may begin with a leading '.', which is ignored.  Case is not significant.  "*" may be used to process files with any extension (or none at all), as in the last three examples:
exiftool -ext JPG DIR             # process only JPG files exiftool --ext cr2 --ext dng DIR  # supported files but CR2/DNG exiftool -ext+ txt DIR            # supported files plus TXT exiftool -ext "*" DIR             # process all files exiftool -ext "*" --ext xml DIR   # process all but XML files exiftool -ext "*" --ext . DIR     # all but those with no ext
Using this option has two main advantages over specifying "*.EXT" on the command line:  1) It applies to files in subdirectories when combined with the -r option.  2) The -ext option is case- insensitive, which is useful when processing files on case-sensitive filesystems.
Note that all files specified on the command line will be processed regardless of extension unless the -ext option is used.
-F[OFFSET] (-fixBase) Fix the base for maker notes offsets.  A common problem with some image editors is that offsets in the maker notes are not adjusted properly when the file is modified.  This may cause the wrong values to be extracted for some maker note entries when reading the edited file.  This option allows an integer OFFSET to be specified for adjusting the maker notes base offset.  If no OFFSET is given, ExifTool takes its best guess at the correct base.  Note that exiftool will automatically fix the offsets for images which store original offset information (eg. newer Canon models).  Offsets are fixed permanently if -F is used when writing EXIF to an image. eg)
exiftool -F -exif:resolutionunit=inches image.jpg
-fast[NUM] Increase speed of extracting information.  With -fast (or -fast1), ExifTool will not scan to the end of a JPEG image to check for an AFCP or PreviewImage trailer, or past the first comment in GIF images or the audio/video data in WAV/AVI files to search for additional metadata.  These speed benefits are small when reading images directly from disk, but can be substantial if piping images through a network connection.  For more substantial speed benefits, -fast2 also causes exiftool to avoid extracting any EXIF MakerNote information.  -fast3 avoids extracting metadata from the file, and returns only pseudo System tags, but still reads the file header to obtain an educated guess at FileType.  -fast4 doesn't even read the file header, and returns only System tags and a FileType based on the file extension.  -fast5 also disables generation of the Composite tags (like -e).  Has no effect when writing.
Note that a separate -fast setting may be used for evaluation of a -if condition, or when ordering files with the -fileOrder option. See the -if and -fileOrder options for details.
-fileOrder[NUM] [-]TAG Set file processing order according to the sorted value of the specified TAG.  For example, to process files in order of date:
exiftool -fileOrder DateTimeOriginal DIR
Additional -fileOrder options may be added for secondary sort keys. Numbers are sorted numerically, and all other values are sorted alphabetically.  Files missing the specified tag are sorted last. The sort order may be reversed by prefixing the tag name with a "-" (eg.  "-fileOrder -createdate").  Print conversion of the sorted values is disabled with the -n option, or a "#" appended to the tag name.  Other formatting options (eg. -d) have no effect on the sorted values.  Note that the -fileOrder option can have a large performance impact since it involves an additional processing pass of each file, but this impact may be reduced by specifying a NUM for the -fast level used during the metadata-extraction phase.  For example, -fileOrder4 may be used if TAG is a pseudo System tag.  If multiple -fileOrder options are used, the extraction is done at the lowest -fast level.  Note that files are sorted across directory boundaries if multiple input directories are specified.
-i DIR (-ignore) Ignore specified directory name.  DIR may be either an individual folder name, or a full path.  If a full path is specified, it must match the Directory tag exactly to be ignored.  Use multiple -i options to ignore more than one directory name.  A special DIR value of "SYMLINKS" (case sensitive) may be specified to avoid recursing into directories which are symbolic links when the -r option is used.  As well, a value of "HIDDEN" (case sensitive) may be used to ignore files with names that start with a "." (ie. hidden files on Unix systems) when scanning a directory.
-if[NUM] EXPR Specify a condition to be evaluated before processing each FILE. EXPR is a Perl-like logic expression containing tag names prefixed by "$" symbols.  It is evaluated with the tags from each FILE in turn, and the file is processed only if the expression returns true. Unlike Perl variable names, tag names are not case sensitive and may contain a hyphen.  As well, tag names may have a leading group names separated by colons, and/or a trailing "#" character to disable print conversion.  The expression $GROUP:all evaluates to 1 if any tag exists in the specified "GROUP", or 0 otherwise (see note 2 below).  When multiple -if options are used, all conditions must be satisfied to process the file.  Returns an exit status of 2 if all files fail the condition.  Below are a few examples:
# extract shutterspeed from all Canon images in a directory exiftool -shutterspeed -if '$make eq "Canon"' dir
# add one hour to all images created on or after Apr. 2, 2006 exiftool -alldates+=1 -if '$CreateDate ge "2006:04:02"' dir
# set EXIF ISO value if possible, unless it is set already exiftool '-exif:iso<iso' -if 'not $exif:iso' dir
# find images containing a specific keyword (case insensitive) exiftool -if '$keywords =~ /harvey/i' -filename dir
Adding NUM to the -if option causes a separate processing pass to be executed for evaluating EXPR at a -fast level given by NUM (see the -fast option documentation for details).  Without NUM, only one processing pass is done at the level specified by the -fast option. For example, using -if5 is possible if EXPR uses only pseudo System tags, and may significantly speed processing if enough files fail the condition.
The expression has access to the current ExifTool object through $self, and the following special functions are available to allow short-circuiting of the file processing.  Both functions have a return value of 1.  Case is significant for function names.
End()    - end processing after this file EndDir() - end processing of files in this directory (not compatible with the B<-fileOrder> option)
1) The -n and -b options also apply to tags used in EXPR.
2) Some binary data blocks are not extracted unless specified explicitly.  These tags are not available for use in the -if condition unless they are also specified on the command line.  The alternative is to use the $GROUP:all syntax. (eg. Use $exif:all instead of $exif in EXPR to test for the existence of EXIF tags.)
3) Tags in the string are interpolated the same way as with -p before the expression is evaluated.  In this interpolation, $/ is converted to a newline and $$ represents a single "$" symbol (so Perl variables, if used, require a double "$").
4) The condition may only test tags from the file being processed. To process one file based on tags from another, two steps are required.  For example, to process XMP sidecar files in directory "DIR" based on tags from the associated NEF:
exiftool -if EXPR -p '$directory/$filename' -ext nef DIR > nef.txt exiftool -@ nef.txt -srcfile %d%f.xmp ...
5) The -a option has no effect on the evaluation of the expression, and the values of duplicate tags are accessible only by specifying a group name (such as a family 4 instance number, eg. $Copy1:TAG, $Copy2:TAG, etc).
6) A special "OK" UserParam is available to test the success of the previous command when -execute was used, and may be used like any other tag in the condition (ie. "$OK").
-m (-ignoreMinorErrors) Ignore minor errors and warnings.  This enables writing to files with minor errors and disables some validation checks which could result in minor warnings.  Generally, minor errors/warnings indicate a problem which usually won't result in loss of metadata if ignored. However, there are exceptions, so ExifTool leaves it up to you to make the final decision.  Minor errors and warnings are indicated by "[minor]" at the start of the message.  Warnings which affect processing when ignored are indicated by "[Minor]" (with a capital "M").  Note that this causes missing values in -tagsFromFile, -p and -if strings to be set to an empty string rather than an undefined value.
-o OUTFILE or FMT (-out) Set the output file or directory name when writing information. Without this option, when any "real" tags are written the original file is renamed to "FILE_original" and output is written to FILE. When writing only FileName and/or Directory "pseudo" tags, -o causes the file to be copied instead of moved, but directories specified for either of these tags take precedence over that specified by the -o option.
OUTFILE may be "-" to write to stdout.  The output file name may also be specified using a FMT string in which %d, %f and %e represent the directory, file name and extension of FILE.  Also, %c may be used to add a copy number. See the -w option for FMT string examples.
The output file is taken to be a directory name if it already exists as a directory or if the name ends with '/'.  Output directories are created if necessary.  Existing files will not be overwritten. Combining the -overwrite_original option with -o causes the original source file to be erased after the output file is successfully written.
A special feature of this option allows the creation of certain types of files from scratch, or with the metadata from another type of file.  The following file types may be created using this technique:
XMP, EXIF, EXV, MIE, ICC/ICM, VRD, DR4
The output file type is determined by the extension of OUTFILE (specified as "-.EXT" when writing to stdout).  The output file is then created from a combination of information in FILE (as if the -tagsFromFile option was used), and tag values assigned on the command line.  If no FILE is specified, the output file may be created from scratch using only tags assigned on the command line.
-overwrite_original Overwrite the original FILE (instead of preserving it by adding "_original" to the file name) when writing information to an image. Caution: This option should only be used if you already have separate backup copies of your image files.  The overwrite is implemented by renaming a temporary file to replace the original. This deletes the original file and replaces it with the edited version in a single operation.  When combined with -o, this option causes the original file to be deleted if the output file was successfully written (ie. the file is moved instead of copied).
-overwrite_original_in_place Similar to -overwrite_original except that an extra step is added to allow the original file attributes to be preserved.  For example, on a Mac this causes the original file creation date, type, creator, label color, icon, Finder tags, other extended attributes and hard links to the file to be preserved (but note that the Mac OS resource fork is always preserved unless specifically deleted with "-rsrc:all=").  This is implemented by opening the original file in update mode and replacing its data with a copy of a temporary file before deleting the temporary.  The extra step results in slower performance, so the -overwrite_original option should be used instead unless necessary.
Note that this option reverts to the behaviour of the -overwrite_original option when also writing the FileName and/or Directory tags.
-P (-preserve) Preserve the filesystem modification date/time ("FileModifyDate") of the original file when writing.  Note that some filesystems store a creation date (ie. "FileCreateDate" on Windows and Mac systems) which is not affected by this option.  This creation date is preserved on Windows systems where Win32API::File and Win32::API are available regardless of this setting.  For other systems, the -overwrite_original_in_place option may be used if necessary to preserve the creation date.  The -P option is superseded by any value written to the FileModifyDate tag.
-password PASSWD Specify password to allow processing of password-protected PDF documents.  If a password is required but not given, a warning is issued and the document is not processed.  This option is ignored if a password is not required.
-progress[:[TITLE]] Show the progress when processing files.  Without a colon, the -progress option adds a progress count in brackets after the name of each processed file, giving the current file number and the total number of files to be processed.  Implies the -v0 option, causing the names of processed files to also be printed when writing.  When combined with the -if option, the total count includes all files before the condition is applied, but files that fail the condition will not have their names printed.
If followed by a colon (ie. -progress:), the console window title is set according to the specified TITLE string.  If no TITLE is given, a default TITLE string of "ExifTool %p%%" is assumed.  In the string, %f represents the file name, %p is the progress as a percent, %r is the progress as a ratio, %##b is a progress bar of width "##" (20 characters if "##" is omitted), and %% is a % character.  May be combined with the normal -progress option to also show the progress count in console messages.  (Note: For this feature to function correctly on Mac/Linux, stderr must go to the console.)
-q (-quiet) Quiet processing.  One -q suppresses normal informational messages, and a second -q suppresses warnings as well.  Error messages can not be suppressed, although minor errors may be downgraded to warnings with the -m option, which may then be suppressed with "-q -q".
-r[.] (-recurse) Recursively process files in subdirectories.  Only meaningful if FILE is a directory name.  Subdirectories with names beginning with "." are not processed unless "." is added to the option name (ie. -r. or -recurse.).  By default, exiftool will also follow symbolic links to directories if supported by the system, but this may be disabled with "-i SYMLINKS" (see the -i option for details). Combine this with -ext options to control the types of files processed.
-scanForXMP Scan all files (even unsupported formats) for XMP information unless found already.  When combined with the -fast option, only unsupported file types are scanned.  Warning: It can be time consuming to scan large files.
-u (-unknown) Extract values of unknown tags.  Add another -u to also extract unknown information from binary data blocks.  This option applies to tags with numerical tag ID's, and causes tag names like "Exif_0xc5d9" to be generated for unknown information.  It has no effect on information types which have human-readable tag ID's (such as XMP), since unknown tags are extracted automatically from these formats.
-U (-unknown2) Extract values of unknown tags as well as unknown information from some binary data blocks.  This is the same as two -u options.
-wm MODE (-writeMode) Set mode for writing/creating tags.  MODE is a string of one or more characters from the list below.  The default write mode is "wcg".
w - Write existing tags c - Create new tags g - create new Groups as necessary
For example, use "-wm cg" to only create new tags (and avoid editing existing ones).
The level of the group is the SubDirectory level in the metadata structure.  For XMP or IPTC this is the full XMP/IPTC block (the family 0 group), but for EXIF this is the individual IFD (the family 1 group).
-z (-zip) When reading, causes information to be extracted from .gz and .bz2 compressed images (only one image per archive; requires gzip and bzip2 to be available).  When writing, causes compressed information to be written if supported by the metadata format (eg. compressed textual metadata in PNG), disables the recommended padding in embedded XMP (saving 2424 bytes when writing XMP in a file), and writes XMP in shorthand format -- the equivalent of setting the API Compress=1 and Compact="NoPadding,Shorthand".
-@ ARGFILE Read command-line arguments from the specified file.  The file contains one argument per line (NOT one option per line -- some options require additional arguments, and all arguments must be placed on separate lines).  Blank lines and lines beginning with "#" are ignored (unless they start with "#[CSTR]", in which case the rest of the line is treated as a C string, allowing standard C escape sequences such as "\n" for a newline).  White space at the start of a line is removed.  Normal shell processing of arguments is not performed, which among other things means that arguments should not be quoted and spaces are treated as any other character. ARGFILE may exist relative to either the current directory or the exiftool directory unless an absolute pathname is given.
For example, the following ARGFILE will set the value of Copyright to "Copyright YYYY, Phil Harvey", where "YYYY" is the year of CreateDate:
-d %Y -copyright<Copyright $createdate, Phil Harvey
Arguments in ARGFILE behave exactly the same as if they were entered at the location of the -@ option on the command line, with the exception that the -config and -common_args options may not be used in an ARGFILE.
-k (-pause) Pause with the message "-- press any key --" or "-- press RETURN --" (depending on your system) before terminating.  This option is used to prevent the command window from closing when run as a Windows drag and drop application.
-list, -listw, -listf, -listr, -listwf, -listg[NUM], -listd, -listx Print a list of all valid tag names (-list), all writable tag names (-listw), all supported file extensions (-listf), all recognized file extensions (-listr), all writable file extensions (-listwf), all tag groups [in a specified family] (-listg[NUM]), all deletable tag groups (-listd), or an XML database of tag details including language translations (-listx).  The -list, -listw and -listx options may be followed by an additional argument of the form "-GROUP:All" to list only tags in a specific group, where "GROUP" is one or more family 0-2 group names (excepting EXIF IFD groups) separated by colons.  With -listg, NUM may be given to specify the group family, otherwise family 0 is assumed.  The -l option may be combined with -listf, -listr or -listwf to add file descriptions to the list.  The -lang option may be combined with -listx to output descriptions in a single language.  Here are some examples:
-list               # list all tag names -list -EXIF:All     # list all EXIF tags -list -xmp:time:all # list all XMP tags relating to time -listw -XMP-dc:All  # list all writable XMP-dc tags -listf              # list all supported file extensions -listr              # list all recognized file extensions -listwf             # list all writable file extensions -listg1             # list all groups in family 1 -listd              # list all deletable groups -listx -EXIF:All    # list database of EXIF tags in XML format -listx -XMP:All -s  # list short XML database of XMP tags
When combined with -listx, the -s option shortens the output by omitting the descriptions and values (as in the last example above), and -f adds a 'flags' attribute if applicable.  The flags are formatted as a comma-separated list of the following possible values:  Avoid, Binary, List, Mandatory, Permanent, Protected, Unknown and Unsafe (see the Tag Name documentation).  For XMP List tags, the list type (Alt, Bag or Seq) is added to the flags, and flattened structure tags are indicated by a Flattened flag.
Note that none of the -list options require an input FILE.
-ver Print exiftool version number.  The -v option may be added to print addition system information (see the README file of the full distribution for more details about optional libraries), or -v2 to also list the Perl include directories.
--   Indicates the end of options.  Any remaining arguments are treated as file names, even if they begin with a dash ("-").
-geotag TRKFILE Geotag images from the specified GPS track log file.  Using the -geotag option is equivalent to writing a value to the "Geotag" tag. The GPS position is interpolated from the track at a time specified by the value written to the "Geotime" tag.  If "Geotime" is not specified, the value is copied from "DateTimeOriginal#" (the "#" is added to copy the unformatted value, avoiding potential conflicts with the -d option).  For example, the following two commands are equivalent:
exiftool -geotag trk.log image.jpg exiftool -geotag trk.log "-Geotime<DateTimeOriginal#" image.jpg
When the "Geotime" value is converted to UTC, the local system timezone is assumed unless the date/time value contains a timezone. Writing "Geotime" causes the following tags to be written (provided they can be calculated from the track log, and they are supported by the destination metadata format):  GPSLatitude, GPSLatitudeRef, GPSLongitude, GPSLongitudeRef, GPSAltitude, GPSAltitudeRef, GPSDateStamp, GPSTimeStamp, GPSDateTime, GPSTrack, GPSTrackRef, GPSSpeed, GPSSpeedRef, GPSImgDirection, GPSImgDirectionRef, GPSPitch, GPSRoll, AmbientTemperature and CameraElevationAngle.  By default, tags are created in EXIF, and updated in XMP only if they already exist.  However, "EXIF:Geotime" or "XMP:Geotime" may be specified to write only EXIF or XMP tags respectively.  Note that GPSPitch and GPSRoll are non-standard, and require user-defined tags in order to be written.
The "Geosync" tag may be used to specify a time correction which is applied to each "Geotime" value for synchronization with GPS time. For example, the following command compensates for image times which are 1 minute and 20 seconds behind GPS:
exiftool -geosync=+1:20 -geotag a.log DIR
Advanced "Geosync" features allow a linear time drift correction and synchronization from previously geotagged images.  See "geotag.html" in the full ExifTool distribution for more information.