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

share|improve this question
add comment

migrated from stackoverflow.com Mar 26 '11 at 14:22

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

2 Answers

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
add comment

you can do some thing like:

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

Your Answer

 
discard

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