centos安装7zip
Posted 古月书斋
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos安装7zip相关的知识,希望对你有一定的参考价值。
本文转载自:http://blog.csdn.net/hellochenlian/article/details/44309969
首先不得不说的事,我先进行了实验。
压缩一个目录html
rar压缩 结果5.18M
zip压缩 结果5.06M
7z压缩 结果870K
第一种,源码编译安装
官网下载地址:http://www.7-zip.org/download.html
源文件项目地址:http://sourceforge.net/projects/p7zip/,目前最新版为9.20.1。
执行以下命令下载安装:
[html] view plain copy- wget http://nchc.dl.sourceforge.net/project/p7zip/p7zip/9.20.1/p7zip_9.20.1_src_all.tar.bz2
- tar -jxvf p7zip_9.20.1_src_all.tar.bz2
- cd p7zip_9.20.1
- make
- make install
如果执行make命令时,提示安装g++的话,请执行
yum install gcc-c++安装g++
最后一步make install后出现以下信息,即为安装完毕
[html] view plain copy
- ./install.sh /usr/local/bin /usr/local/lib/p7zip /usr/local/man /usr/local/share/doc/p7zip
- - installing /usr/local/bin/7za
- - installing /usr/local/man/man1/7z.1
- - installing /usr/local/man/man1/7za.1
- - installing /usr/local/man/man1/7zr.1
- - installing /usr/local/share/doc/p7zip/README
- - installing /usr/local/share/doc/p7zip/ChangeLog
- - installing HTML help in /usr/local/share/doc/p7zip/DOCS
第二种,rpm安装
下载地址:http://pkgs.repoforge.org/p7zip/,请以最新版为准。
在 CentOS 5.x 32位下安装7ZIP
[html] view plain copy
- wget http://pkgs.repoforge.org/p7zip/p7zip-9.20.1-1.el5.rf.i386.rpm
- rpm -ivh p7zip-9.20.1-1.el5.rf.i386.rpm
在 CentOS 5.x 64位下安装7ZIP
[html] view plain copy
- wget http://pkgs.repoforge.org/p7zip/p7zip-9.20.1-1.el5.rf.x86_64.rpm
- rpm -ivh p7zip-9.20.1-1.el5.rf.x86_64.rpm
在 CentOS 6.x 32位下安装7ZIP
[html] view plain copy
- wget http://pkgs.repoforge.org/p7zip/p7zip-9.20.1-1.el6.rf.i686.rpm
- rpm -ivh p7zip-9.20.1-1.el6.rf.i686.rpm
在 CentOS 6.x 64位下安装7ZIP
第三种,yum安装
通过《在Centos 5.x或6.x上安装RHEL EPEL Repo》一文,安装RHEL EPEL Repo后,即可使用yum安装7ZIP。
命令如下:
[html] view plain copy
- 7-Zip (A) [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18
- p7zip Version 9.20 (locale=zh_CN.UTF-8,Utf16=on,HugeFiles=on,1 CPU)
- Usage: 7za <command> [<switches>...] <archive_name> [<file_names>...]
- [<@listfiles...>]
- <Commands>
- a: Add files to archive
- b: Benchmark
- d: Delete files from archive
- e: Extract files from archive (without using directory names)
- l: List contents of archive
- t: Test integrity of archive
- u: Update files to archive
- x: eXtract files with full paths
- <Switches>
- -ai[r[-|0]]@listfile|!wildcard: Include archives
- -ax[r[-|0]]@listfile|!wildcard: eXclude archives
- -bd: Disable percentage indicator
- -i[r[-|0]]@listfile|!wildcard: Include filenames
- -mParameters: set compression Method
- -oDirectory: set Output directory
- -pPassword: set Password
- -r[-|0]: Recurse subdirectories
- -scsUTF-8 | WIN | DOS: set charset for list files
- -sfx[name]: Create SFX archive
- -si[name]: read data from stdin
- -slt: show technical information for l (List) command
- -so: write data to stdout
- -ssc[-]: set sensitive case mode
- -tType: Set type of archive
- -u[-][p#][q#][r#][x#][y#][z#][!newArchiveName]: Update options
- -vSize[b|k|m|g]: Create volumes
- -w[path]: assign Work directory. Empty path means a temporary directory
- -x[r[-|0]]]@listfile|!wildcard: eXclude filenames
以上是关于centos安装7zip的主要内容,如果未能解决你的问题,请参考以下文章