11

I have two folders (ORIGINAL A and ORIGINAL B), and both do have subfolders.

How do I merge these two folders (and subfolders) to DESTINATION C?

a) ORIGINAL A and ORIGINAL B do have the same subfolders. I want to copy every unique file of any subfolder into the "correct" subfolder of DESTINATION C

b) some subfolders are only in ORIGINAL A, but not in ORIGINAL B. I want any folder in DESTINATION C

Does anyone know a terminal command?

1 Answer 1

15

Try:

rsync -aP /ORIGINAL_A/* /DESTINATION_C/

This is like a copy of the folder A

rsync -aP /ORIGINAL_B/* /DESTINATION_C/

That should sync the folders A an B to another the new folder C.

You could sync the file from A to B directly but you don't will have data loss this way.

2
  • thx dude, you made my day. This is exactly what I was looking for!
    – Produnis
    Feb 22, 2013 at 13:52
  • What to do if rsync is not available? How to do it with CP?
    – Max
    Jan 23, 2017 at 17:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .