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 it was 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 a file with 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
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 been completed.
Using the tool
Once the installation has been completed, you can 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.
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 about 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:
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.
Now you can check the new file with the same command as before:
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
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
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.
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
Now you have cleared up your disk space and completely uninstalled ExifTool.
Conclusion
With detailed instructions, I hope you can remove the EXIF data from your images without 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 through the process.