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.

find -newermt "mar 03, 2010 09:00" -not -newermt "mar 11, 2010" -exec cp {} destination \;
  • 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. – Paused until further notice. Nov 13 '10 at 15:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.