How to copy in bash all directory and files recursive?

前端 未结 2 1870
醉酒成梦
醉酒成梦 2020-12-23 08:55

I have script:

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

SourceDir contains also sub-folders.

相关标签:
2条回答
  • 2020-12-23 09:09

    code for a simple copy.

    cp -r ./SourceFolder ./DestFolder
    

    code for a copy with success result

    cp -rv ./SourceFolder ./DestFolder
    

    code for Forcefully if source contains any readonly file it will also copy

    cp -rf ./SourceFolder ./DestFolder
    

    for details help

    cp --help
    
    0 讨论(0)
  • 2020-12-23 09:28
    cp -r ./SourceFolder ./DestFolder
    
    0 讨论(0)
提交回复
热议问题