Copy files from one folder to another folder within specific date range
Don't use cp
directly with the output of find
.
It might passes way many too files in a single step (and that's why you get the error Argument list too long
).
Use the -exec
parameter of find
, which execute the given command passing a every matched file to cp
, one at a time:
cd /share/new/
find . -type f -newermt '16 july 2018' -exec cp {} /share/test \;
use find -exec
:
find /share/new/ -type f -newermt '16 july 2018' -exec cp {} /share/test \;