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

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

方法:命令行

cd /home/study/test

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

以上,即可将/home/study/test目录中,除test1和test2目录外,其余全部的文件和文件夹copy到/home/copydircode

相关文章
相关标签/搜索