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.

link|improve this question

sounds like a question stackoverflow.com or unix.stackexchange.com . – Johan Nov 13 '10 at 12:12
feedback

1 Answer

up vote 2 down vote accepted
find -newermt "mar 03, 2010 09:00" -not -newermt "mar 11, 2010" -exec cp {} destination \;
link|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
feedback

Your Answer

 
or
required, but never shown

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