Strip EXIF Data from files
Here is a one liner to Strip EXIF data from photos:
find -name ‘*.png’ -print0 | xargs -0 -r mogrify -format png
This line of code assumes that you are looking for png files. You can substitute jpg or anything you would like to find and alter. You need to be in the directory that your files are in so that you can effectively use this command. For more code like this go to our one liner’s page.
You can also use exiftool (download here)
This would overwrite the original metadata and leave it blank. Note: Be careful there is no backup files in this one.
You can also overwrite just the gps data by typing in:
exiftool -ext JPG -overwrite_original -gps:all= .
exiftool is a very flexible tool to rewrite exif data and comes in very handy when you want to rewrite metadata to keep your privacy online. GPS data should be kept private, unfortunately camera phones have GPS and record that on each and every photo. So, before you upload your photos to your favorite social media site make sure they are “clean”.