Read & Remove EXIF Data From the Command Line
Most digital cameras will insert metadata into images. This metadata is stored using the exchangeable image file format (EXIF) and can contain camera specifications, exposure settings, thumbnails, GPS coordinates and more. This article outlines the command line tools you can use for reading and removing EXIF metadata from JPEG images.
Reading EXIF Metadata From the Command Line
Jhead is a command line tool for displaying EXIF data embedded in JPEG images. On Fedora, use Yum to install Jhead:
su -c 'yum install jhead'
Now, use /usr/bin/jhead to read EXIF metadata:
jhead dsc_0790.jpg
Here is an example of the output produced by the jhead command:
File name : dsc_0790.jpg
File size : 4654488 bytes
File date : 2008:07:16 09:45:20
Camera make : NIKON CORPORATION
Camera model : NIKON D200
Date/Time : 2007:06:23 22:00:14
Resolution : 3880 x 2608
Flash used : No
Focal length : 50.0mm (35mm equivalent: 75mm)
Exposure time: 0.025 s (1/40)
Aperture : f/2.0
ISO equiv. : 100
Exposure bias: 1.00
Whitebalance : Auto
Exposure : aperture priority (semi-auto)
GPS Latitude : ? ?
GPS Longitude: ? ?
======= IPTC data: =======
(C)Flag : 0
DateCreated : 20070623
Time Created : 220014
Record vers. : 4
Removing EXIF Metadata From the Command Line
If you need to strip the EXIF metadata from images, use ImageMagick’s mogrify command. To install ImageMagick on Fedora, use Yum:
su -c 'yum install ImageMagick'
After ImageMagick is installed, you will have /usr/bin/mogrify available. The mogrify command can be used to strip Exif data from images.
mogrify -strip imagename.jpg
If you need to process a large number of files, use find and xargs:
find ./folder_of_images -name '*.jpg' | xargs mogrify -strip







