I want to retrieve specific files then cp
the result into another directory. It is all working, but my command seems to be executed a second time.
For example, I have a file a
and I want to cp
it into subdirectory test/
, so I run:
find . -mtime -1 -name a -exec cp {} test/ ';'
My file is copied into the subdirectory as I wanted but then I get this error message:
cp: './test/a' and 'test/a' are the same file
-maxdepth 1
find -name a ! -path './test/*' ...