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

想使用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



标签: none

评论已关闭