Dealing with pictures on your computer, you might have come across EXIF data without knowing what it is. Images with EXIF data reveal all the details about a photo such as where and when was it taken as well as with what device, amongst a host of many other things. While this is commonly a desirable feature for many, it raises privacy concerns for many others, especially if they want to share their pictures online via social media. Having file EXIF data consumes more disk space when compared to those without it. In this guide, we will take a stab at answering the question “how to remove file EXIF data in Linux?”.

There are various tools available for Ubuntu to remove Exif data from pictures, but ExifTool works the best in my experience. It removes the metadata from the image without recompressing it, keeping it at its original quality.

It allows you to remove the EXIF data with a variety of options, e.g., you can save the same image without the metadata or export a new copy without it.

Installing ExifTool

Fire up your terminal and type the following to start the installation:

$sudo apt install libimage-exiftool-perl

Install Exiftool

Depending on the speed of your Internet connection, this process will take some time.

Once you get the prompt back, it means that the installation has completed.

Installation complete

Using the tool

Once the installation has been completed, you are ready to start using the tool.
You can view the metadata by executing this:

$exiftool [image.png]

In the command above, you need to replace the “image.png” with the file name and extension of your image.

Using ExifTool

In this example, I placed an image on the desktop. It’s a picture I took at a local event. These are just some of the attributes I am sharing as even I got scared as to the extent of the information stored with this image. Here you can see various file attributes like permissions, type, and extension amongst many others including the make and model of my mobile phone. If you scroll down, you will see a whole host of attributes such as:

Remove GEO/GPS references in images

Now if you want to remove the exif data you can execute the following, using the “-all” input argument.

$exiftool -all= me.jpg

Running this will save a copy of your original image with the exif data removed from it. The original filename will be updated. It will now have “_original” added at the end.

Remove all Exif data

Now you can check the new file with the same command as before:

Exif data removed from image

You can see that it has generic attributes saved with it.

Now if you want to only remove file exif data in Linux, just run this:

$exiftool -EXIF=me.jpg

Furthermore, if you want to remove the file exif data without saving a copy of the file, you can try this:

$exiftool -overwrite_original -all=me.jpg

Don't save a copy of original image

You can see that the file was updated, and no copy was created.

If you want to be thorough and want to use this tool on your Pictures folder along with all of the subfolders, you can try this command to remove the exif data from all of the images in the folder and subsequent sub-folders:

$exiftool -recurse -all= Pictures

Remive Exif data from all pictures / images

For more information on all the options of the Exiftool, you can run this to learn more about this tool:

$man exiftool

It will give you comprehensive details on all of the options available with your installation of the exiftool.

More help on using Exiftool

Uninstalling the tool

Once you are done with processing all of your pictures and removing the file exif data from your images, and you want to remove the exiftool, go to your terminal and use this:

$sudo apt remove libimage-exiftool-perl

Remove Exiftool

Now you have cleared up your disk space and completely uninstalled ExifTool.

Conclusion

With detailed instructions, I hope you are able to remove the exif data from your images without much hassle. Removing this data, you can rest assured that no one will be able to pinpoint your location or intrude on your privacy over the Internet. If you run into any issues while doing this, feel free to drop a comment below and I’ll gladly help you out through the process.

How to Remove File Exif Data with ExifTool in Ubuntu 20.04

Karim Buzdar

About the Author: Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. You can reach Karim on LinkedIn