Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a folder containing photos coming from different cameras.

I use Imagemagick to convert to resized and renamed photos in another folder.

Something like this:

convert "*.jpg" \
    -resize 640 -scene 1 \

The problem is some cameras save photos with "JPG" extension, others with "jpg".

To solve this I used to rename extensions with this:

rename .JPG .jpg *.JPG 2> /dev/null

This won't work on filesystems where I have only read access. How do I glob in IM both *.jpg and *.JPG files?

Thanks for your help

share|improve this question

I got it:

convert "*.{jpg,JPG}" \
    -resize 640 -scene 1 \

from here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.