$linuxjunkies
>

exiv2(1)

exiv2 is a command-line utility and library for reading, writing, and manipulating EXIF, IPTC, and XMP metadata in image files.

UbuntuDebianFedoraArch

Synopsis

exiv2 [OPTION]... [FILE]...

Description

exiv2 provides comprehensive metadata manipulation for JPEG, TIFF, PNG, CR2, CRW, MRW, NEF, DNG, and other image formats. It can extract, edit, insert, and delete EXIF data, IPTC tags, and XMP information. The command supports batch operations, format conversions, and regex-based tag manipulation.

Metadata can be read from one image and written to another, renamed based on EXIF timestamps, or completely stripped from files. exiv2 is widely used in photography workflows, automated image processing, and digital asset management systems.

Common options

FlagWhat it does
-eextract metadata (EXIF, IPTC, XMP) to separate files
-iinsert metadata from extracted files back into an image
-ddelete metadata (EXIF, IPTC, XMP) from image files
-pprint metadata values; used with -Exif, -Iptc, -Xmp flags
-Mmodify metadata from command line; format: key=value
-rextract/insert files using a regex pattern for filename
-cwrite command output to stdout instead of file
-nbypass filename modifications; useful with -r flag
--Exifprint only EXIF tags (use with -p)
--Iptcprint only IPTC tags (use with -p)
--Xmpprint only XMP tags (use with -p)
-vverbose output with detailed processing information

Examples

Print all EXIF metadata from photo.jpg to stdout

exiv2 -p E photo.jpg

Extract EXIF, IPTC, and XMP metadata to separate .exif, .iptc, and .xmp files

exiv2 -e photo.jpg

Set the EXIF DateTime to 2024:01:15 10:30:00 in photo.jpg

exiv2 -M "Exif.Image.DateTime=2024:01:15 10:30:00" photo.jpg

Delete all EXIF, IPTC, and XMP metadata from photo.jpg

exiv2 -d photo.jpg

Rename image files based on EXIF DateTime metadata

exiv2 -r photo1.jpg photo2.jpg photo3.jpg

Insert previously extracted metadata files back into photo.jpg

exiv2 -i photo.jpg

Print only EXIF tags and filter for Orientation information

exiv2 --Exif -p v photo.jpg | grep Orientation

Set camera make and model EXIF tags for all JPEG files in directory

exiv2 -M "Exif.Image.Make=Canon" -M "Exif.Image.Model=EOS 5D Mark IV" *.jpg