Strip Image Metadata From Linux Cli

06 Jan 2023 - Nathanael Gandhi

How to strip the metadata out of your images from the linux commandline

I want to start posting more images to this website, however, sometimes the metadata includes things I would prefer not to share openly. This was the motivation for looking up ways to remove this metadata conveniently, and for me ExifTool by Phil Harvey is perfect.

Johannes Eva has a great writeup about this tool: How to edit EXIF metadata via the command line with ExifTool

The commands I plan to keep on hand are:

Keep the original file & remove all metadata from a file

exiftool -all= filename.extension

Keep the original file & remove all metadata from the current directory

exiftool -all= .

Overwrite the original file & remove all metadata from a file

exiftool -all= -overwrite_original filename.extension

Overwrite the original file & remove all metadata from the current directory

exiftool -all= -overwrite_original .