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

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

方法:

1. cd /home/study/test

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


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


猜你喜欢

转载自blog.csdn.net/u010889390/article/details/51525247
cp