Saturday, October 27, 2012

find by modified date and copy to another directory

find . -type f -daystart -mtime -2 -exec cp "{}" [PathToTargetDirectory/] \;

-daystart -mtime -2
starts with the beginning of today counting files modified -2*24 hours ago ...

-exec receives found filename "{}"

... only works with one directory-level - not with nested folders!!