What ImageMagick command will display the orientation of a JPG file?
You can use
identify -format '%[EXIF:Orientation]'
as per identify -format docs (It's the bit further down about exif metadata).
Try
identify -verbose
To see what metadata is in the image (for example if the image was not taken with a camera, the orientation tag will not be set).
Alternatively you could do something like
identify -format '%wx%h'
which gives you the width by height (e.g. '800x598', '1936x2592') and use these to determine whether the image is upright or not (not sure how reliable this is though - sometimes you take a portrait image with a camera and the EXIF data will correctly record the orientation, but the image may still appear landscape).