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 my downloaded directory with many rar files and I'm trying to move them. How would I do that?

share|improve this question

migrated from Mar 26 '11 at 14:22

This question came from our site for professional and enthusiast programmers.

You asked for a zsh solution, here you are:

mv (#i)**/*.r(ar|<->) destination

(#i)makes the search case-insensitive

** is searching recursively, use *** if the search should follow symbolic links

<-> matches a number, but you can also specify a range, e.g. <1-20>

(A|B) matches A or B

So, with the above command you will capture *.rar, *.r01, ..., but also *.RAR, *.R1, *.R2

share|improve this answer

you can do some thing like:

find -name ".rar" -exec cp {} dest_dir \;
share|improve this answer

You must log in to answer this question.