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 would like to write a bash script (or just use a command in the CLI) to

  1. find all the instances within a given directory and its subdirectories for a given time period
  2. copy those files into a given directory that i could pass as an argument

Thanks for any help... I'm a newbie to bash scripting. I'm migrating from one plat to another, so any help would be appreciated, even a link.

share|improve this question
    
sounds like a question stackoverflow.com or unix.stackexchange.com . –  Johan Nov 13 '10 at 12:12
add comment

1 Answer

up vote 2 down vote accepted
find -newermt "mar 03, 2010 09:00" -not -newermt "mar 11, 2010" -exec cp {} destination \;
share|improve this answer
    
thanks a ton. i should add (for the archives) that it should be 'find . xxx' instead of without, since i wanted it to be recursive. very very much appreciated! –  jml Nov 13 '10 at 13:12
    
@jml: GNU find doesn't require an explicit start directory. It defaults to . and is recursive by default. –  Dennis Williamson Nov 13 '10 at 15:50
add comment

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.