Why does the following does not copy the files to the destination folder?
# find /home/shantanu/processed/ -name '*2011*.xml' -exec cp /home/shantanu/tosend {} \;
cp: omitting directory `/home/shantanu/tosend'
cp: omitting directory `/home/shantanu/tosend'
cp: omitting directory `/home/shantanu/tosend'
If your intent is to copy the found files into /home/shantanu/tosend
, you have the order of the arguments to cp
reversed:
find /home/shantanu/processed/ -name '*2011*.xml' -exec cp "{}" /home/shantanu/tosend \;
Please, note: the find
command use {}
as placeholder for matched file.