On Linux, how do I recursively copy files ignoring specific names?

I need to recursively copy the directory tree, ignoring any subdirectories named "CVS". Is there an easy way to do this?

+6
linux scripting unix shell copy
source share
3 answers
tar -cpf - --exclude=CVS directory | sh -c 'cd /wherever/it/goes && tar -xpf -' 

Change the right tar options to -xvpf if you want to see what happens.

+9
source share
 rsync -av --exclude=CVS <src> <dst> 
+12
source share

Why not approach it from a slightly different angle and check the files from CVS using the export command.

This will give you directories without any CVS artifacts.

+7
source share

All Articles