Linux下解压命令大全

        .tar

        解压:tar xvf filename.tar

        打包:tar cvf filename.tar dirname

----------------------------------------------------

        .gz

        解压:gzip -d filename.gz / gunzip filename.gz

        压缩:gzip filename

----------------------------------------------------

        .tar.gz/.tgz

        解压:tar zxvf filename.tar.gz

        压缩:tar zcvf filename.tar.gz dirname

----------------------------------------------------

        .bz2

        解压:bzip2 -d filename.bz2 / bunzip2 filename.bz2
解压gz和tar_gz tar

        压缩:bzip2 -z filename

----------------------------------------------------

        .tar.bz2

        解压:tar jxvf filename.tar.bz2

        压缩:tar jcvf filename.tar.bz2 dirname

----------------------------------------------------

        .bz

        解压:bzip2 -d filename.bz / bunzip2 filename.bz

        压缩:unknown

----------------------------------------------------

        .tar.bz

        解压:tar jxvf filename.tar.bz

        压缩:unknown

----------------------------------------------------

        .Z

        解压:uncompress filename.Z

        压缩:compress filename

----------------------------------------------------

        .tar.Z

        解压:tar Zxvf filename.Z

        压缩:tar Zcvf filename.tar.Z dirname

----------------------------------------------------

        .zip

        解压:unzip filename.zip

        压缩:zip filename.zip dirname

----------------------------------------------------

        .rar

        解压:rar a filename.rar

        压缩:rar e filename.rar

----------------------------------------------------

        gzip命令

        -c     将输出写到标准输出上,并保留原文件.

        -d     将压缩文件解压

        -l     对每个压缩文件显示:

                    压缩文件大小/未压缩文件大小/压缩比/未压缩文件文件名

        -r     递归查找指定目录并压缩其中的所有文件或者解压缩

        -t     测试,检查压缩文件是否完整

        -v     对每个压缩和解压缩的文件,显示文件名和压缩比

        -num 用指定num调整压缩速度.

                    -1/--fast:最快&压缩比最低;

                    -9/--best:最慢&压缩比最高;

                    缺省为6