linux打包压缩常用命令

打包:


zip   gzip  bzip2 tar  xz     //rar


zip


zip   xxx.zip     test.c  
压缩
unzip  xxx.zip             
解压    解压之后还有压缩包

gzip
gzip   test.c        ==>    test.c.gz   
压缩
gunzip   test.c.gz   ==>   test.c   
解压   解压后没有压缩包

bzip2 
bzip2  test.c        ==>    test.c.bz2  
压缩   
bunzip2   test.c.bz2 ==>    test.c   
解压   解压后没有压缩包

xz
xz     test.c        ==>    test.c.xz
xz  -d test.c.xz    ==>    test.c
unxz   test.c.xz     ==>   test.c  
解压   解压后没有压缩包

打包
tar
tar    -cf   test.c.tar  test.c      ==>   test.c.tar
tar    -cvf  test.c.tar  test.c      ==>   test.c.tar
c  ==> create
f  ==> file

tar   -xvf   test.c.tar      ==>  test.c
     -xf                    ==>   test.c

x  ==> uncompress
v  ==> view      
能看到解压或者压缩的过程

复合型
aaa.tar.xz    aaa.tar.bz2   aaa.tar.gz

打成  aaa.tar.gz
tar  -czvf   aaa.tar.gz  aaa    ==>
生成aaa.tar.gz
tar  -xzvf   aaa.tar.gz          ==>  aaa
解压   解压后有压缩包

tar  -cjvf   aaa.tar.bz2  aaa   ==>  aaa.tar.bz2
tar  -xjvf   aaa.tar.bz2         ==> aaa


xz
压包

tar  -cvf   aaa.tar  aaa   ==>  aaa.tar
xz  aaa.tar                 ==>  aaa.tar.xz

unxz  aaa.tar.xz            ==>  aaa.tar
tar  -xvf aaa.tar          ==>  aaa

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Engineer-Bruce_Yang

谢谢您

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值