您的位置:首页 > 运维架构 > Linux

linux打包压缩常用命令

2016-02-07 17:36 369 查看
打包:

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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: