Linux tar压缩文件夹,排除该文件夹下的某些文件夹或文件

文件结构:

比如:要对Basewww下Base文件夹进行压缩,其中不压缩phpmyadmin文件夹,不压缩zip.php文件;

1.切换目录到Basewww;

cd Basewww

2.压缩命令:

要排除多个的话,后边继续追加:--exclude=Base/xxx

tar -zcvf Base.tar.gz Base --exclude=Base/phpmyadmin --exclude=Base/zip.php

 

备注:压缩Base文件夹命令:

tar -zcvf Base.tar.gz Base

猜你喜欢

转载自blog.csdn.net/dreamLeadToword/article/details/83652396