Gzip 压缩工具


[root@binbinlinux ~]# gzip install.log.syslog     压缩命令gzip   不可以压缩目录

[root@binbinlinux ~]# ls

0.txt  1234.1   1.txt  anaconda-ks.cfg        test.txt

1      123.txt  222    install.log            tmp

111    12.txt   234    install.log.syslog.gz    压缩的文件带gz   yun

[root@binbinlinux ~]# du -sh install.log.syslog.gz

8.0K    install.log.syslog.gz

[root@binbinlinux ~]# gzip -1 压缩比例最少 然后压缩速度最快  9 压缩比例最大 压缩速度最慢   默然是6 级别  一共9级别   

[root@binbinlinux ~]# gzip -d install.log.syslog.gz      解压缩命令 -d  

[root@binbinlinux ~]# ls

0.txt  1234.1   1.txt  anaconda-ks.cfg     test.txt

1      123.txt  222    install.log         tmp

111    12.txt   234    install.log.syslog  yun

Gzip -c 1.sh。Gz > /usr/local/src/1.sh   输出的意思 从定向的意思

    Bzip2

[root@binbinlinux ~]# bzip2 install.log.syslog  压缩文件命令     不可以压缩目录  

[root@binbinlinux ~]# ls

0.txt  1234.1   1.txt  anaconda-ks.cfg         test.txt

1      123.txt  222    install.log             tmp

111    12.txt   234    install.log.syslog.bz2  yun

[root@binbinlinux ~]# du -sh  install.log.syslog.bz2

8.0K    install.log.syslog.bz2

[root@binbinlinux ~]# bzip2 -d  install.log.syslog.bz2   解压命令  

[root@binbinlinux ~]# ls

0.txt  1234.1   1.txt  anaconda-ks.cfg     test.txt

1      123.txt  222    install.log         tmp

111    12.txt   234    install.log.syslog  yun

[root@binbinlinux ~]# bzcat test.txt.bz2    查看bzip2 压缩的文件  

[root@binbinlinux ~]# zcat install.log.syslog.gz   查看 gz压缩的文件

Xz压缩

[root@binbinlinux ~]# xz 123.txt   压缩命令  

[root@binbinlinux ~]# ls

0.txt  111     123.txt.xz  1.txt  234              install.log         test.txt  yun

1      1234.1  12.txt      222    anaconda-ks.cfg  install.log.syslog  tmp

[root@binbinlinux ~]# xz -d 123.txt.xz     解压缩

[root@binbinlinux ~]# ls

0.txt  111     123.txt  1.txt  234    

[root@binbinlinux ~]# bzcat 123.txt.xz   查看123,命令