Here is what I am trying to do - assume a source directory:
cp -r /xyz/*/file.txt /z/*/
cp -r /xyz/2/file.txt /z/2/
cp -r /xyz/3/file.txt /z/3/
This command copies from
z excluding all files named
rsync -a --exclude=crapfile.txt xyz/ z
-v (verbose) option, we can see its work in progress:
$ rsync -va --exclude=crapfile.txt xyz/ z sending incremental file list ./ 2/ 2/file.txt 3/ 3/file.txt
As you can see,
file.txt was copied but
crapfile.txt was skipped.
rsync is a very power utility with many many options. For more info, see
man rsync or any of the
rsync tutorials on the web.