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

相關文章
相關標籤/搜索