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 ?
24 Answers
cp -r ./SourceFolder ./DestFolder 6 code for a simple copy.
cp -r ./SourceFolder ./DestFoldercode for a copy with success result
cp -rv ./SourceFolder ./DestFoldercode for Forcefully if source contains any readonly file it will also copy
cp -rf ./SourceFolder ./DestFolderfor details help
cp --help also try this cp -r ./dist/* ./out;
this command will copy dist/* files to out dir;
You might find it handy to keep your attributes set
cp -arf ./SourceFolder ./DestFolder