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
  • 698,132
  • 130
  • 858
  • 1,229
Gjaa
  • 1,254
  • 1
  • 18
  • 18

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
  • 12