some commands for compression and decompression

1. compressed file format

        .zip  .gz  .bz2  .tar.gz  .tar.bz2

2. commands for zip format

        zip [compressed file name]  [source file name]

        zip -r [compressed file name]  [source directory name]

        unzip [compressed file name]

3. commands for gz format

        gzip [source file name]  ->  the source file will be deleted

        gzip -c [source file name] > [compressed file name]   ->  the source file will not be deleted

        gzip -r [source directory name]  ->  compress all the files one by one under source directory, can not compress the directory

        gzip -d [compressed file name]  ->  decompress the file

        gunzip [compressed file name]  ->  decompress the file

        gunzip -r [compressed directory file name]  -> decompress the directory

4. commands for bz2 format (can not compress the directory)

        bzip2 [source file name]  ->  the source file will be deleted

        bzip2 -k [source file name]  ->  the source file will be not deleted

        bzip2 -d [compressed file name]  ->  decompress the file

        bunzip2 [compressed file name]  ->  decompress the file

5. commands for .tar

        tar -cvf [package file name] [source file name]

                -c  pack

                -v  view process

                -f  specify file name after the package

        tar -xvf [package file name]

                -x  unpack

        tar -zcvf [package file name] [source file name]

                -z  compress the directory to .tar.gz format    ->  use blank to add anothor file

        tar -zxvf [package file name]

                -x  decompress the .tar.gz format file

        tar -jcvf [package file name] [source file name]

                -j  compress the directory to .tar.bz2 format

        tar -jxvf [package file name]

                -x  decompress the .tar.bz2 format file

        tar -[zxvf / jxvf] -C

                -C  specify the directory for decompressed files

        tar -ztvf [package file name]

                -t  test the package file name that see the list of the packed files

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值