bzip2/bunzip2/bzcat  命令

【NAME】
     bzip2, bunzip2 - a block-sorting file compressor, v1.0.6
     bzcat - decompresses files to stdout
     bzip2recover - recovers data from damaged bzip2 files
【SYNOPSIS】
     bzip2  [OPTION]...  FILE...
【OPTIONS】
     -d:解压缩
     -#:指定压缩比;默认是6;数字越大压缩比越大(1-9);
     -k:keep,保留原文件;
【EXAMPLES】
示例:
 
    
  1. [root@Centos7-171 tmp]# bzip2 messages   #压缩
  2. [root@Centos7-171 tmp]# ll -h messages*
  3. -rw------- 1 root root 5.8K Mar 22 16:26 messages.bz2
  4. -rw-r--r-- 1 root root 7.0K Mar 22 16:27 messages.gz
  5. [root@Centos7-171 tmp]# bzip2 -d messages.bz2   #解压缩
  6. [root@Centos7-171 tmp]# ll -h messages
  7. -rw------- 1 root root 85K Mar 22 16:26 messages
示例:bzip2 -k参数,压缩后保留原文件;
 
    
  1. [root@Centos7-171 tmp]# bzip2 -k messages
  2. [root@Centos7-171 tmp]# ll -h messages*
  3. -rw------- 1 root root  85K Mar 22 16:26 messages
  4. -rw------- 1 root root 5.8K Mar 22 16:26 messages.bz2
  5. -rw-r--r-- 1 root root 7.0K Mar 22 16:27 messages.gz
示例:bzcat,查看bzip2压缩后的文件内容
 
    
  1. [root@Centos7-171 tmp]# bzcat messages.bz2