The simplest way is to use "mogrify". Example: mogrify -rotate 90 *.jpg (where 90 are 90 degrees)