linux 压缩与解压缩

gzip/bzip2/xz

gzip/gunzip
          后缀名:.gz
           -#: 压缩比,默认为6,范围为0-9;
           -d : gunzip
           -c: 将压缩后的结果输出至标准输出,
           gzip -c /path/to/somefile > /path/to/somecfile.gz

           zcat somefile.gz: 不解压查看gzip压缩后的文件的内容

 bzip2/bunzip2
 

bz2
            -#: 压缩比,默认为6,范围为1-9;
            -d: bunzip2
            -k: 保留原文件

            bzcat somefile.bz2: 

 xz/unxz
 

 xz
            -#: 压缩比,默认为6,范围为0-9;
            -d: unxz
            -k: 保留原文件

            xzcat somefile.xz

 zip/unzip

  zip ZIPFILE.zip src_file...
  unzip ZIPFILE.zip

tar:归档工具能实现将多个文件打包成单个文件,即为归档文件

 tar [option]... -f tarfile.tar src_file...

        创建归档:
            tar
                -c: create
                -f FILE.tar: 指定归档后的文件
                -v: 显示执行过程

        展开归档:
            tar
                -x: extract
                -v:
                -f FILE.tar

        查看归档后的文件中包含了哪些原文件:
            tar
                -t:
                -f FILE.tar

        tar可直接通过选项调用压缩工具执行压缩或解压:
            -z: gzip
            -j: bzip2
            -J: xz

 


      

 

posted @ 2019-01-23 20:23  Coolc  阅读(229)  评论(0编辑  收藏  举报