Sow nothing reap nothing

LINUX操作命令-打包压缩命令

已有2,216次关注

gzip:
bzip2:
tar:                打包压缩
    -c              归档文件
    -x              压缩文件
    -z              gzip压缩文件
    -j              bzip2压缩文件
    -v              显示压缩或解压缩过程 v(view)
    -f              使用档名

例:

tar -cvf /home/abc.tar /home/abc              只打包,不压缩
tar -zcvf /home/abc.tar.gz /home/abc        打包,并用gzip压缩
tar -jcvf /home/abc.tar.bz2 /home/abc      打包,并用bzip2压缩

当然,如果想解压缩,就直接替换上面的命令

tar -cvf  / tar -zcvf  / tar -jcvf 中的“c” 换成“x” 就可以了。

已自动关闭评论