Linux batch conversion: Change quality of jpg with convert but keep its name
convert command help:
convert input-file [options] output-file
Now a little script to convert all jpg files to 80% quality of original under current directory
for file in *.jpg; do
convert "$file" -quality 80% "$file"
done;
Try this instead:
mogrify -quality 80% *.jpg
This will work for you.
convert -quality 80% '*.jpg' -set filename:original %t %[filename:original].jpg