Command to Delete EXIF Metadata in Image Files

By Xah Lee. Date: . Last updated: .

What is ExifTool

ExifTool is a command line tool to remove metadata in image files. e.g. date, camera info, GSP info (location).

It's available for {Windows, Mac, Linux}.

Install

ExifTool home page at https://exiftool.org/

Remove Metadata

# remove all metadata of a image file
exiftool -all= -overwrite_original xyz.jpg
# remove all metadata of all jpg files in current dir
exiftool -all= -overwrite_original -ext jpg .
# remove metedata for all jpg files in current dir and subdirs
exiftool -all= -r -overwrite_original -ext jpg .

Common Options

File Name Extension Option is Case-Insensitive

The -ext jpg is Case-Insensitive.

View Metadata

# show metadata of a image file
exiftool xyz.jpg
# show metedata for all jpg files in current dir
exiftool -ext jpg .
# show metedata for all jpg files in current dir and subdirs
exiftool -r -ext jpg .

Here's sample metadata in jpg file and mp3 file:

Remove just GPS data

# remove all GPS metadata of jpg files in current dir
exiftool -gps:all= *.jpg

Exiftool Manual

Metadata outside images, IPTC, XMP, etc.

Metadata is also stored is various different formats, for files other than image files. For example, video files, and even text files. Two popular general-purpose metadata formats are: IPTC, XMP. There's also the ID3 format for MP3 audio files. There's also Mac OS X Extended Attributes.

2013-10-24 thanks to Nick Alcock