Welcome to jaever.com/diary

Linux压缩打包命令使用方法之bzip2, bzcat 命令

[root@linux ~]# bzip2 [-cdz] 档名
[root@linux ~]# bzcat 档名.bz2
参数:
-c :将压缩的过程产生的资料输出到萤幕上!
-d :解压缩的参数
-z :压缩的参数
-# :与 gzip 同样的,都是在计算压缩比的参数, -9 最佳, -1 最快!
范例:
范例一:将刚刚的 /tmp/man.config 以 bzip2 压缩
[root@linux tmp]# bzip2 -z man.config
# 此时 man.config 会变成 man.config.bz2 !

范例二:将范例一的文件内容读出来!
[root@linux tmp]# bzcat man.config.bz2
# 此时萤幕上会显示 man.config.bz2 解压缩之后的文件内容!!

范例三:将范例一的文件解压缩
[root@linux tmp]# bzip2 -d man.config.bz2

范例四:将范例三解开的 man.config 用最佳的压缩比压缩,并保留原本的文件
[root@linux tmp]# bzip2 -9 -c man.config > man.config.bz2

INFO: 2008-06-29 13:26:08 | purpen | digg | link

Copyright © 2008 Jaever. All rights reserved.

This Site looks and works best when viewed using browsers enabled with JavaScript 1.5 and CSS, such as Firefox 1+ or Safari 3+.