Linux压缩打包命令使用方法(bzip2, bzcat 命令)
[root@linux ~]# bzip2 [-cdz] 档名
[root@linux ~]# bzcat 档名.bz2
参数:
-c :将压缩的过程产生的资料输出到萤幕上.
-d :解压缩的参数
-z :压缩的参数
-# :与 gzip 同样的,都是在计算压缩比的参数, -9 最佳, -1 最快.
范例:
范例一:将刚刚的 /tmp/man.config 以 bzip2 压缩
CODE: [root@linux tmp]# bzip2 -z man.config |
# 此时 man.config 会变成 man.config.bz2 .
范例二:将范例一的文件内容读出来.
CODE: [root@linux tmp]# bzcat man.config.bz2 |
# 此时萤幕上会显示 man.config.bz2 解压缩之后的文件内容.
范例三:将范例一的文件解压缩
CODE: [root@linux tmp]# bzip2 -d man.config.bz2 |
范例四:将范例三解开的 man.config 用最佳的压缩比压缩,并保留原本的文件
append:
bzcat –help
bzip2, a block-sorting file compressor. Version 1.0.3, 15-Feb-2005.
usage: bzcat [flags and input files in any order]
-h –help print this message
-d –decompress force decompression
-z –compress force compression
-k –keep keep (don’t delete) input files
-f –force overwrite existing output files
-t –test test compressed file integrity
-c –stdout output to standard out
-q –quiet suppress noncritical error messages
-v –verbose be verbose (a 2nd -v gives more)
-L –license display software version & license
-V –version display software version & license
-s –small use less memory (at most 2500k)
-1 .. -9 set block size to 100k .. 900k
–fast alias for -1
–best alias for -9
If invoked as `bzip2′, default action is to compress.
as `bunzip2′, default action is to decompress.
as `bzcat’, default action is to decompress to stdout.
If no file names are given, bzip2 compresses or decompresses
from standard input to standard output. You can combine
short flags, so `-v -4′ means the same as -v4 or -4v, &c.
转载请注明:在路上 » Linux压缩打包命令使用方法(bzip2, bzcat 命令)