#!/bin/bash for f in $(ls *jpg); do convert $f -quality 85 temp mv temp $f done