0

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?

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
Gjaa
  • 1,461
  • 1
  • 19
  • 20

1 Answers1

1

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
Community
  • 1
  • 1
Pyrogrammer
  • 173
  • 1
  • 12