【发布时间】:2020-04-12 10:07:38
【问题描述】:
我的目录树看起来有点像这样:
/Volumes/Data/TEMP/DROP
├───R1
│ ├───morestuff
│ │ └───stuff2
│ │ └───C.tool
│ └───stuff
│ ├───A.tool
│ └───B.Tool
└───R2
├───morestuff
│ └───stuff2
│ └───C.tool
└───stuff
├───A.tool
└───B.Tool
如何将*.tool 目录从R1 递归复制到(覆盖)R2 中的目录?我的 bash 已经生锈了大约 20 年。
【问题讨论】:
-
stackoverflow.com/questions/61104639/… 请参阅我的答案
find /Volumes/Data/TEMP/DROP/R1 -type d -iname "*.tool" -exec cp -a --parents {} /Volumes/Data/TEMP/DROP/R2 \;的编辑部分 -
将
rsync与排除过滤器一起使用,请参阅man7.org/linux/man-pages/man1/rsync.1.html#INCLUDE/…
标签: bash