linux下压缩工具

压缩、解压缩及归档工具

         compress/uncompress:.z

         gzip/gunzip:.gz

         bzip2/bunzip2:.bz2

         xz/unxz:.xz

         zip/unzip

         tar,cpio

         1、gzip/gunzip

                gzip [option] file

                           -d:解压缩,相当于gunzip

                            -c:将结果输出至标准输出

                            -#:1-9,指定压缩比

                           gzip-9 –c messages > message2.2.gz

                  zcat:不显式展开的前提下查看文本文件的内容:

         2.bzip2/bunzip2/bzczt

                bzip2 [option] file

                            -k:keep,保留原文件

                            -d:解压缩

                            -#:1-9:指定压缩比

                   bzcat:不显式展开的前提下查看文本文件内容

         3、xz/unxz/xzcat

                     xz [option] file

                            -k:keep,保留原文件

                            -d:解压缩

                            -#:1-9:指定压缩比

                   xzcat:不显式展开的前提下查看文本文件内容

         4.tar

                   tar[option] file1,file2…

(1)创建归档

        tar  -c –f/path/to/somefile.tar  file…

        tar  -cf/path/to/somefile.tar  file…

(2)查看归档

        tar –t –f /path/to/somefile.tar

(3)展开归档

        tar –x –f /path/to/somefile.tar

        tar –x –f /path/to/somefile.tar –C /path/to/dir

                   结合压缩工具实现,归档并压缩

                            -j:bzip2,-z:gzip,-J:xz

猜你喜欢

转载自blog.csdn.net/matengbing/article/details/80248845