Example:
dir1
|_ filea
|_ fileb
|_ foldera
|_ filez
|_ folderxy
|_ filexy
I want to copy dir1
with cp -r dir1 desti/nation
but omitting folderxy
.
How can I do that?
Example:
dir1
|_ filea
|_ fileb
|_ foldera
|_ filez
|_ folderxy
|_ filexy
I want to copy dir1
with cp -r dir1 desti/nation
but omitting folderxy
.
How can I do that?
Try rsync. If you have a lot of stuff to exclude you can create a file and pass it in as --exclude-from=filename
. Look at this answer here.
rsync -av --exclude='path1' --exclude='path2' source destination