Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

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 or . – Johan Nov 13 '10 at 12:12
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

Your Answer


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.