Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

up vote 2 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

Your Answer

 
discard

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.