需要安装 lzo 和 lzop
一、lzo 安装
1. 下载lzo文件
[root@localhost ~]# wget http://www.oberhumer.com/opensource/lzo/download/lzo-2.06.tar.gz
2. 编译安装
[root@localhost ~]# tar xzvf lzo-2.06.tar.gz
[root@localhost ~]# cd lzo-2.06
[root@localhost lzo-2.06]# ./configure --enable-shared
[root@localhost lzo-2.06]# make
[root@localhost lzo-2.06]# make install
3. 复制lib
[root@localhost ~]# cp /usr/local/lib/*lzo* /usr/lib64/
二、lzop安装
1. 下载lzop包
[root@localhost ~]# wget 'http://www.lzop.org/download/lzop-1.03.tar.gz'
2. 编译安装
[root@localhost ~]# tar xzvf lzop-1.03.tar.gz
[root@localhost ~]# cd lzop-1.03
[root@localhost lzop-1.03]# ./configure
[root@localhost lzop-1.03]# make
[root@localhost lzop-1.03]#make install
如果lzop提示找不到命令,尝试执行:
[root@localhost ~]#ln -s /usr/local/bin/lzop /usr/bin/lzop
三、测试
[root@localhost ~]# lzop -V
Lempel-Ziv-Oberhumer Packer
Copyright (C) 1996 - 2010
lzop v1.03 Markus Franz Xaver Johannes Oberhumer Nov 1st 2010
lzop version: v1.03, Nov 1st 2010
lzop build date: Feb 1 2013 12:37:12
命令使用帮助:
[root@localhost ~]# lzop -h
Lempel-Ziv-Oberhumer Packer
Copyright (C) 1996 - 2010
lzop v1.03 Markus Franz Xaver Johannes Oberhumer Nov 1st 2010
Usage: lzop [-dxlthIVL19] [-qvcfFnNPkUp] [-o file] [-S suffix] [file..]
Commands:
-1 compress faster -9 compress better
-d decompress -x extract (same as -dPp)
-l list compressed file -I display system information
-t test compressed file -V display version number
-h give this help -L display software license
Options:
-q be quiet -v be verbose
-c write on standard output -oFILE write output to 'FILE'
-p write output to current dir -pDIR write to path 'DIR'
-f force overwrite of output files
-n do not restore the original file name (default)
-N restore the original file name
-P restore or save the original path and file name
-S.suf use suffix .suf on compressed files
-U delete input files after successful operation (like gzip and bzip2)
file.. files to (de)compress. If none given, try standard input.
测试压缩文件:
[gateway@localhost home]$ time lzop tianqitong_20130130.log
real 0m7.429s
user 0m5.260s
sys 0m1.100s
485M tianqitong_20130130.log.lzo
[gateway@localhost home]$ time gzip tianqitong_20130130.log
real 1m9.639s
user 1m1.615s
sys 0m0.881s
293M tianqitong_20130130.log.gz