Super User is a question and answer site for computer enthusiasts and power users. 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 with a range of numbered files (camera images) and I'd like to move every other image into a different folder, so either all the odd numbered images, or all the even ones. How can I do this using unix commands?

  IMG_0001.CR2 [move this]
IMG_0002.CR2
  IMG_0003.CR2 [move this]
IMG_0004.CR2
  IMG_0005.CR2 [move this]
IMG_0006.CR2
share|improve this question
up vote 5 down vote accepted

Try this:

mkdir odd; mv *[13579].CR2 odd
share|improve this answer
1  
Perfect, thank you @duDE ! – Jamie Apr 25 '13 at 10:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .