I want to use the find command to copy files that contain 2012 from one directory to another. I tried
find /Volumes/movies1 -name "*.2012.*" -exec cp -nRv "{}" /Volumes/pdrive/ \;
I want to use the find command to copy files that contain 2012 from one directory to another. I tried
find /Volumes/movies1 -name "*.2012.*" -exec cp -nRv "{}" /Volumes/pdrive/ \;
Try:
find /Volumes/movies1 -name "*2012*" -print | xargs -r cp -nRv -t /Volumes/pdrive/
I have to look into xargs thanks. I did man xargs but do not see a lowercase -r argument. What does that do?
---------- Post updated at 08:16 PM ---------- Previous update was at 07:58 PM ----------
find /Volumes/movies1/ -name "*2012*" -print0 | xargs -0 -I filename cp -nRv filename /Volumes/pdrive/
I came up with this that got the job done. Thanks