Find to copy files into single directory

Posted on Wednesday, January 20th, 2010 at 4:49 pm in

Makes copy of subset of dir/ and below with files that match the criteria. It keeps the nested directory structure. Uses

-print0 | xargs -0

to handle spaces in Windows names
find /cygdrive/f/dir1/ -name '*.doc' -print0 | xargs -0 cp -a --target-directory=/cygdrive/c/Temp --parents
You might also be interested in

Add your comment

Leave a Reply

Leave A Comment

Top