LinuxCommandLibrary

exif

Read and write image's EXIF metadata

TLDR

Show all recognized EXIF information in an image

$ exif [path/to/image.jpg]
copy

Show a table listing known EXIF tags and whether each one exists in an image
$ exif [[-l|--list-tags]] --no-fixup [path/to/image.jpg]
copy

Extract the image thumbnail into a separate file
$ exif [[-e|--extract-thumbnail]] [[-o|--output]] [path/to/thumbnail.jpg] [path/to/image.jpg]
copy

Show the raw contents of the "Model" tag in the given image
$ exif --ifd [0] [[-t|--tag]] "Model" [[-m|--machine-readable]] [path/to/image.jpg]
copy

Change the value of the "Artist" tag to John Smith and save to new.jpg
$ exif [[-o|--output]] [path/to/new.jpg] --ifd [0] [[-t|--tag]] "Artist" --set-value "John Smith" --no-fixup [path/to/image.jpg]
copy

SYNOPSIS

exif [OPTION]... [FILE]...

PARAMETERS

-c, --canonical
    Print output in canonical Exif format

-m, --machine
    Print output in machine-readable format

-n, --numerical
    Print numerical tag values (no labels)

-o, --output=FILE
    Write output to FILE instead of stdout

-t, --tag=TAG
    Print only the specified TAG (e.g., 'DateTimeOriginal')

-u, --unknown
    Also print unknown tags

-h, --help
    Display help and exit

-V, --version
    Output version information and exit

DESCRIPTION

The exif command-line tool extracts and displays EXIF (Exchangeable Image File Format) metadata from digital image files, primarily JPEG photos taken by cameras and smartphones.

EXIF data includes critical details like camera model, lens used, exposure time, aperture, ISO speed, shutter speed, focal length, date and time of capture, GPS coordinates (if geotagged), orientation, and thumbnails. This makes exif invaluable for photographers reviewing shoot settings, forensic analysis, organizing photo libraries, or verifying image authenticity.

By default, it provides a human-readable dump of all standard tags. Options allow customization, such as machine-parsable output for scripting, numerical values without labels, or extracting specific tags. It relies on the libexif library for robust parsing, handling maker notes and proprietary extensions from brands like Canon, Nikon, and Sony.

Common use cases include batch processing directories of images or piping data into other tools for automation. Note that not all images contain EXIF data, and it may be stripped by editing software.

CAVEATS

Primarily supports JPEG files; limited TIFF handling. Requires libexif library. Ignores non-image files silently. Output format changes with options may break scripts.

EXAMPLE USAGE

exif photo.jpg
Display all tags from photo.jpg.

exif -t 'GPSLatitude' -t 'GPSLongitude' photo.jpg
Extract GPS coordinates only.

exif -m *.jpg
Machine-readable output for all JPEGs.

TAG LIST

Common tags: DateTimeOriginal, Make, Model, ExposureTime, FNumber, ISO, FocalLength. Use exif -l if supported for full list (non-standard).

HISTORY

Part of libexif project, initiated in 2002 by Lutz Mueller for reliable Exif parsing. Command-line tool evolved through versions, with stable releases tied to libexif 0.6.x series (circa 2006+). Widely packaged in Linux distros since mid-2000s.

SEE ALSO

exiftool(1), jhead(1), identify(1)

Copied to clipboard