Strip most EXIF and IPTC headers
exiftool -all= -photoshop:all= myphoto.jpg
This command copies the original photo, appending
_original to the filename.
The image is not recompressed so image quality is not affected.
Not all headers can be removed, so the responsibility is yours to understand what you’re posting on the Internet and sharing electronically or otherwise.
Linux / Windows Subsystem for Linux
apt install libimage-exiftool-perl
brew install exiftool