How to copy in bash all directory and files recursive?

user710818 picture user710818 · Nov 8, 2011 · Viewed 159.9k times · Source

I have script:

find ./SourceFolder/ -maxdepth 4 -exec cp -R '{}' ./DestFolder/ \;

SourceDir contains also sub-folders.

Problem that in DestFolder not only all tree, but in up level all another levels and files.

How to fix ?

Answer

lanzz picture lanzz · Nov 8, 2011
cp -r ./SourceFolder ./DestFolder