Linux 打包压缩&排除文件

 

#tar -cvf 文件名 文件夹 <==仅打包,不压缩!
#tar -zcvf 文件名 文件夹 <==打包后,以 gzip 压缩
#tar -jcvf 文件名 文件夹 <==打包后,以 bzip2 压缩

 


排除指定文件:

 

排除test目录下a文件夹
#tar -zcvf test.tar.gz --exclude=test/a test

 

排除test目录下a、b文件夹
#tar -zcvf test.tar.gz --exclude=test/a --exclude=test/b test


posted on 2011-12-22 18:53  、邦  阅读(511)  评论(0编辑  收藏  举报

导航