READING EXAMPLES
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).
exiftool -common dir
Print common meta information for all images in dir.
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 -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 -ee -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.

WRITING EXAMPLES
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 (ie. -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 http://owl.phy.queensu.ca/~phil/exiftool/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.

COPYING EXAMPLES
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 XMP, ICC and MIE files may be created like this (other file types 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 -@ 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 -if '$jpgfromraw' -b -jpgfromraw -w %d%f_%ue.jpg -execute -if '$previewimage' -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).

RENAMING EXAMPLES
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 http://owl.phy.queensu.ca/~phil/exiftool/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. ie) 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 -p option documentation 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".

GEOTAGGING EXAMPLES
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 http://owl.phy.queensu.ca/~phil/exiftool/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. (Note that the Geotag tag must be assigned before Geotime for the GPS data to be available when Geotime is set.)
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. (In this case, the order of the arguments doesn't matter because tags with values copied from other tags are always set after constant values.)
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.

PIPING EXAMPLES
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.
wget -qO - http://a.domain.com/bigfile.jpg | exiftool -fast -
Extract information from an image over the internet using the GNU wget 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.)