Command to Delete EXIF Metadata in Image Files
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
... dirpath
→ put dir path as last arg.-r
→ recursive (all nested subdirs)-ext jpg -ext jpeg -ext jfif -ext png
→ all jpg and png files-all=
→ all metadata.-overwrite_original
→ overwrite original.
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:
- exiftool sample output on JPG file: metadata_sample_exif.txt
- exiftool sample output on MP3 file: metadata_sample_id3.txt
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