美文网首页
Linux-cp拷贝,略过不想拷贝的目录

Linux-cp拷贝,略过不想拷贝的目录

作者: 人在码途 | 来源:发表于2017-01-18 11:05 被阅读181次

想使用CP拷贝一个大目录(/home/study/test),但又不想拷贝其中的一个子目录(/home/study/test/test1),应该如何写命令行

方法:

cd /home/study/test

rsync -av --exclude  test1/ --exlclude test2/  ../test/  /home/copydir

以上,便可将/home/study/test目录中,除test1和test2目录外,其他所有的文件和文件夹copy到/home/copydir

相关文章

网友评论

      本文标题:Linux-cp拷贝,略过不想拷贝的目录

      本文链接:https://www.haomeiwen.com/subject/hhgvbttx.html