1

I am a bit embarassed that, as a long-time linux user, I don't have an answer to this:

+- root-dir
+- dest

If I run cp -r root-dir dest/, then the complete content of root-dir is copied to dest/, including hidden files.

However, the result is

+-root-dir
+-dest
+----+ root-dir

If I do this though: cp -r root-dir/* dest/, then indeed I have all the content of root-dir at the dest/ folder with desired hierarchy - but the hidden files are not copied.

How can I get an exact copy of root-dir into dest but not as a subfolder? I can't just remove dest and rename it later, because dest already has some content which should be kept (in fact these are all git folders).

In other words, I want to merge both directories including hidden files. I also tried rsync -a but that seems to also exclude hidden files.

0 Answers0