Dear all,
Does anyone aware of any utility to copy files which are created or modify form a specific date ?.
Thanks
Rajeev R. Veedu
On Mon, Jun 9, 2008 at 11:16 AM, Rajeev R. Veedu rajeev@cracknell.com wrote:
Dear all,
Does anyone aware of any utility to copy files which are created or modify form a specific date ?.
Use find with either -exec or with xargs, and pass it either a -ctime or -mtime option for what you need.
for example, find /path/ -type f -mtime -2 -name '*.txt' -exec cp {} /path/to/copy/to/
this may not be 100% syntactically correct, but should give you the general idea.
On Jun 9, 2008, at 11:16 AM, Rajeev R. Veedu wrote:
Does anyone aware of any utility to copy files which are created or modify form a specific date ?.
to copy all files in /dir1 modified within the last 5 days to /dir2:
$ find /dir1 -mtime -5 | xargs -I {} cp {} /dir2
if the filenames have whitespace in them, you can use this trick:
$ find /dir1 -mtime -5 -print0 | xargs -0 -I {} cp {} /dir2
for more details on selecting by time:
$ man find
pay particular attention to the options -atime, -amin, -ctime, -cmin, -mtime, -mmin, and -daystart.
-steve --
If this were played upon a stage now, I could condemn it as an improbable fiction. - Fabian, Twelfth Night, III,v