cp 复制目录的坑

[work@01video app]$ cp -af dict01 dict02
[work@01video app]$ diff dict01/models/service/data/LiveTask.php dict02/models/service/data/LiveTask.php
3d2
<  * haha

既然复制目录没有报错,理论上应该会覆盖成功。那实际cp的内容在哪?

[work@tjwq01-ibu-video007089 app]$ ls livetran-20191223test
xxx  xxx  livetran-20191223 xxx xxx

如果想要批量替换目录,且dict02目录存在,需要在cp 的原始目录后加 /*

[work@01video app]$ cp -af dict01/* dict02
[work@01video app]$ diff dict01/models/service/data/LiveTask.php dict02/models/service/data/LiveTask.php
[work@01video app]$

你可能感兴趣的:(基础知识)