The command-line program jpegtran provides several features for reformatting and recoding the representation of the DCT coefficients, for transformation of actual image data and for discarding auxiliary data in JPEG files, respectively.
I found two slightly conflicting blog posts on this matter, here I summarize: jpegoptim and jpegtran perform identically and produce …
jpeg libjpeg-turbo jpegoptim jpegtran mozjpeg