Linux下的p7zip 压缩和解压缩7z格式文件

                                                 Linux下的p7zip 压缩和解压缩7z格式文件

下载地址:https://pan.baidu.com/s/1g8AxcfMdmbgIfxJZ-XxVvA 提取码:p7zz

下载上传到服务器后,素质三连,解压,make,make install,

tar jxf p7zip_9.20.1_src_all.tar.bz2 

cd p7zip_9.20.1/

make && make install

帮助文件内容如下:

[root@centos11 p7zip_9.20.1]# 7za --help

7-Zip (A) [64] 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18
p7zip Version 9.20 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,4 CPUs)

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
  -m{Parameters}: set compression Method
  -o{Directory}: set Output directory
  -p{Password}: set Password
  -r[-|0]: Recurse subdirectories
  -scs{UTF-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
  -t{Type}: Set type of archive
  -u[-][p#][q#][r#][x#][y#][z#][!newArchiveName]: Update options
  -v{Size}[b|k|m|g]: Create volumes
  -w[{path}]: assign Work directory. Empty path means a temporary directory
  -x[r[-|0]]]{@listfile|!wildcard}: eXclude filenames
  -y: assume Yes on all queries


常用的选项为 -a -x -l -d,-e,

命令使用参数与方法:
a 添加到压缩文件
b 基准测试,测试7z当前性能
d 从压缩文件中删除
e 从压缩文件中解压缩,但不包含目录结构(即所有各级文件都解压到一个目录里)
l 列出压缩文件的内容
t 测试压缩文件
u 更新文件到压缩文件
x 从压缩文件中解压缩,包含目录结构

以压缩和解压缩 /etc  目录为例:

[root@centos11 ~]# 7za a  etc.7z /etc  压缩/etc 目录,压缩文件为etc.7z

[root@centos11 aa]# 7za l etc.7z     查看压缩文件的内容 是L 注意。

[root@centos11 aa]# 7za x etc.7z 解压缩一般使用x,e参数虽然也是解压缩,但是,目录结构是乱的。

[root@centos11 aa]# 7za a -p etcs.7z  /etc/ 压缩 /etc/ 目录为etcs.7z   文件,但设置密码,-p参数选项。 这个文件解压的时候需要输入刚才所设置的密码

[root@centos11 ~]# 7za x etcs.7z -o/root/ 解压缩文件内容到  /root 目录下。注意,-o  和路径之间没有空格

 

 

 

 

猜你喜欢

转载自blog.csdn.net/alwaysbefine/article/details/112973620
今日推荐