Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

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.

share|improve this answer
    
thx dude, you made my day. This is exactly what I was looking for! –  Produnis Feb 22 '13 at 13:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.