Use ImageMagick (this way keep EXIF data)
convert DSCN0001.JPG -resize 800x600 small.jpg
Use netpbm (this way lose EXIF data)
jpegtopnm DSCN0001.JPG | pnmscale -width=800 -height=600 | pnmtojpeg > small.jpg
ref. EXIF