photometadata.netEXIF · GPS · METADATA

How to Remove EXIF Data on Linux

Strip GPS coordinates, camera model, and capture timestamps from photos on any Linux distro — with ExifTool from the terminal, an ImageMagick one-liner, or a point-and-click GUI — the same job our cross-platform guide to remove photo metadata covers for Windows, Mac, and mobile.

The command you came for

With exiftool installed, this removes every writable metadata tag from a photo and overwrites it in place, without re-encoding the pixels:

exiftool -all= -overwrite_original photo.jpg

Whole folder: exiftool -all= -overwrite_original -r ~/Pictures/album — jump to ExifTool, ImageMagick, a GUI, or verification.

Method 1: ExifTool (the Reliable Default)

ExifTool reads and writes EXIF, IPTC, XMP, GPS, and maker-note blocks in JPEG, PNG, TIFF, HEIC, and RAW files. It edits the metadata segments directly, so your image data is untouched — there is no re-compression and no quality loss.

Install it:

# Debian / Ubuntu
sudo apt install libimage-exiftool-perl

# Fedora / RHEL
sudo dnf install perl-Image-ExifTool

# Arch
sudo pacman -S perl-image-exiftool

Strip everything:

exiftool -all= photo.jpg

By default ExifTool keeps a backup of the untouched file next to it as photo.jpg_original. That is a safety net, not a bug — but it means the original metadata is still on your disk. Add -overwrite_original to skip the backup once you are confident, or delete the _original files afterwards.

Useful variations:

# Remove only GPS coordinates, keep camera settings
exiftool -gps:all= -overwrite_original photo.jpg

# Every image in a folder, recursively
exiftool -all= -overwrite_original -r ~/Pictures/album

# Only JPEGs, recursively
exiftool -all= -overwrite_original -r -ext jpg -ext jpeg ~/Pictures

# Strip metadata but keep the colour profile so colours stay correct
exiftool -all= --icc_profile:all -overwrite_original photo.jpg

# Write clean copies to another folder, leaving originals alone
exiftool -all= -o clean/ -r ~/Pictures/album

Watch the colour profile. -all= deletes the embedded ICC profile too. For a photo destined for the web that is usually fine (browsers assume sRGB), but if the file was tagged Adobe RGB or Display P3, dropping the profile can shift the colours. The --icc_profile:all variant above excludes the profile from the delete.

Method 2: ImageMagick (Already Installed on Many Systems)

If ImageMagick is already on the machine, -strip removes profiles, comments, and the EXIF block in one pass. It is the shortest path when you are already resizing or converting images in a script.

# Install (Debian/Ubuntu)
sudo apt install imagemagick

# ImageMagick 7 — strip in place
magick mogrify -strip photo.jpg

# ImageMagick 7 — write a clean copy
magick photo.jpg -strip clean.jpg

# Every JPEG in the current folder, in place
magick mogrify -strip *.jpg

# ImageMagick 6 (older distros) drops the "magick" prefix
mogrify -strip photo.jpg

The trade-off: mogrify and magick decode and re-encode the JPEG, so you lose a little image quality every time you run them, and the file is rewritten even if nothing changed. ExifTool edits only the metadata segment and leaves the compressed pixel data byte-for-byte identical. If image fidelity matters, prefer Method 1.

-strip also removes the ICC colour profile. Use -strip +profile "!icc,*" if you need to keep it.

Method 3: A GUI — gThumb

Not everything needs a terminal. gThumb is a GNOME image browser packaged for essentially every distro, and it can wipe metadata from a whole selection of photos in a few clicks.

sudo apt install gthumb      # Debian / Ubuntu
sudo dnf install gthumb      # Fedora
flatpak install flathub org.gnome.gThumb
  1. Open gThumb and browse to the folder with your photos.
  2. Select one or more images (Ctrl-click, or Ctrl+A for the whole folder).
  3. Open the Tools menu and choose Delete Metadata.
  4. Confirm. gThumb clears the EXIF, IPTC, and XMP blocks from the selected files in place.

Because it writes in place with no undo, copy the folder first if you might want the originals — gThumb does not leave a _original backup the way ExifTool does.

Two other GUI options worth knowing: Metadata Cleaner (a Flatpak front-end to the mat2 library, drag-and-drop, handles PDFs and audio too) and the mat2 command-line tool it wraps, which is packaged on most distros as mat2.

Method 4: No Install — Use Your Browser

On a machine where you cannot install packages — a locked-down work laptop, a live USB, someone else's desktop — our free browser tool strips the whole metadata block without uploading anything. It runs entirely in Firefox or Chrome on your own machine; the photo never leaves it.

  1. Open photometadata.net and choose one or more photos.
  2. Review what is actually in the files — GPS on a map, camera model, timestamps, exposure settings.
  3. Click Strip Metadata & Download to get clean copies (a ZIP if you selected several).
Open Photo Metadata Viewer

Like ImageMagick, the browser tool re-encodes the JPEG (at 95% quality). For an archival original, use ExifTool.

Verify Metadata Removal on Linux

Never assume the strip worked. Different tools miss different blocks — a GPS tag can survive in an XMP sidecar section that a naive stripper ignores. Check the output file before you share it; our guide to stripping metadata before sharing shows which platforms leak EXIF and which strip it for you.

# Dump every tag ExifTool can find, grouped and short-named
exiftool -a -G1 -s photo.jpg

# Check specifically that no GPS tag survived (should print nothing)
exiftool -gps:all photo.jpg

# ImageMagick's view of profiles and properties
identify -verbose photo.jpg | less

# Confirm nothing was missed across a whole folder
exiftool -r -if '$gpslatitude' -filename ~/Pictures/album

A fully stripped JPEG still reports a handful of lines from exiftool: file name, size, MIME type, image dimensions, bit depth, encoding process, and the JFIF version. Those are structural properties read from the image itself, not embedded metadata — there is nothing to remove, and their presence does not mean the strip failed. What should be gone is everything in the [EXIF], [GPS], [XMP], [IPTC], and maker-note groups.

The last command above is the one to run before publishing a folder: it walks every file and prints the name of any that still has a GPS latitude. Silence means you are clean.

Prefer to see it, not grep it?

Drop the stripped file into our EXIF viewer for a visual confirmation that GPS, camera, and timestamps are gone. Runs locally in your browser.

Open the EXIF Viewer

Which Method Should You Use?

ToolRe-encodes the image?Best for
ExifToolNoAnything you care about — precise control, every format, lossless.
ImageMagickYesScripts that already resize or convert; it is one more flag.
gThumbNoBatch cleanup without the terminal, browsing thumbnails as you go.
Browser toolYesMachines where you cannot install software.

Related Guides

Frequently Asked Questions

What is the command to remove EXIF data in Linux?

exiftool -all= -overwrite_original photo.jpg deletes every writable metadata tag and rewrites the file in place. Drop -overwrite_original and ExifTool leaves the untouched file beside it as photo.jpg_original. Add -r and point at a directory to do a whole folder.

Does removing EXIF with ExifTool reduce image quality?

No. ExifTool rewrites only the metadata segments of the file and copies the compressed image data across unchanged, so the pixels are byte-for-byte identical. ImageMagick's -strip is different — it decodes and re-encodes the JPEG, which loses a little quality each time.

What are the _original files ExifTool left behind?

They are ExifTool's automatic backups of the pre-edit files. They still contain the full original metadata, including GPS, so delete them once you have verified the strip: find . -name "*_original" -delete. Or skip them in the first place with -overwrite_original.

How do I remove only the GPS location and keep camera settings?

Use exiftool -gps:all= -overwrite_original photo.jpg. That clears the GPS group — latitude, longitude, altitude, timestamp — and leaves aperture, ISO, lens, and camera model intact. Useful when you want to publish the shooting data of a photo without publishing where you stood.

Does ExifTool work on PNG, HEIC, and RAW files?

Yes. -all= works on PNG text chunks, HEIC metadata, and TIFF/DNG. Proprietary RAW formats are a special case: ExifTool deliberately refuses to strip most metadata from formats like CR2 and NEF because the file structure depends on it. For RAW, export a JPEG and strip that instead.

How do I check whether the metadata is actually gone?

Run exiftool -a -G1 -s photo.jpg and look for [EXIF], [GPS], or [XMP] groups — there should be none. A few structural lines (file size, image dimensions, JFIF version) always remain and are not metadata. You can also drop the file into our EXIF viewer for a visual check.

Check a photo before you publish it

See every EXIF field in your browser — no upload, no install, works on any Linux desktop.

Open Photo Metadata Viewer