First of all, install ImageMagick.
Resize the image:
magick original.jpg -resize 30% destination.jpg
Change the image compression level:
magick original.jpg -quality 80 destination.jpg
For more information, run:
man magick
Reduce many images in one command
for file in *.jpg; do
magick "$file" -quality 50 "reduced_$file"
done