【问题标题】:Linux: How to copy recursively omitting certain folder? [closed]Linux:如何递归复制省略某些文件夹? [关闭]
【发布时间】:2015-12-05 20:57:47
【问题描述】:

例子:

dir1  
|_ filea  
|_ fileb  
|_ foldera  
   |_ filez  
|_ folderxy  
   |_ filexy  

我想复制 dir1cp -r dir1 desti/nation 但省略 folderxy

我该怎么做?

【问题讨论】:

  • rsync 使用--exclude 选项。

标签: linux bash copy cp


【解决方案1】:

试试 rsync。如果您有很多东西要排除,您可以创建一个文件并将其作为--exclude-from=filename 传递。看看这个答案here

rsync -av --exclude='path1' --exclude='path2' source destination

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-10-20
    • 2020-12-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-11-04
    • 1970-01-01
    相关资源
    最近更新 更多