命令行压缩工具7z.exe使用详解

7z是一款开源的压缩工具,以其强大的压缩比和丰富的格式支持著称。本文详细介绍了7z.exe在Windows命令行下的使用,包括压缩、解压文件的示例,内存使用情况,命令行语法,以及各种命令参数的详细说明,如固实模式、多线程和不同压缩算法的选择。此外,还提供了其他实用的命令行选项和实例,帮助用户更好地在命令行环境下操作7z。
摘要由CSDN通过智能技术生成

一.简介

7z,全称7-Zip, 是一款开源软件。是目前公认的压缩比例最大的压缩解压软件。

主要特征:

# 全新的LZMA算法加大了7z格式的压缩比

# 支持格式:

* 压缩 / 解压缩:7z, XZ, BZIP2, GZIP, TAR, ZIP

* 仅解压缩:ARJ, CAB, CHM, CPIO, DEB, DMG, FAT, HFS, ISO, LZH, LZMA, MBR, MSI, NSIS, NTFS, RAR, RPM, UDF, VHD, WIM, XAR, Z

主页:http://www.7-zip.org/

中文主页:http://7z.sparanoid.com/

命令行版本下载:http://7z.sparanoid.com/download.html

SourceForge下载:http://sourceforge.net/projects/sevenzip/?source=typ_redirect

7z.exe在Windows cmd窗口使用说明如下:

7-Zip (A) 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18

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
  -ssw: compress shared files
  -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

中文使用说明如下:

语法:
7z <命令行> [<选项>...] <基本档案名称> [<参数变量>...]

7z <command> [<switch>...] <base_archive_name> [<arguments>...]* g8 T1 {- l2 e) P% T' V; A
<参数变量> ::= <选项> | <通配符> | <文件名> | <文件列表>
<选项>::= <选项标记><选项字符>[<选项>]
<选项标记> ::= '/' | '-'
<文件列表> ::= @{文件名}
( @4 _; F   r6 j. t+ a5 @

<arguments> ::= <switch> | <wildcard> | <filename> | <list_file>
<switch>::= <switch_symbol><switch_characters>[<option>]
<switch_symbol> ::= '/' | '-'
<list_file> ::= @{filename}
在方括号内的表达式(“[” 和 “]”之间的字符)是可选的。' ?2 k0 k/ m* f. Q$ c4 h
在书名号内的表达式(“<” 和 “>”之间的字符)是必须替换的表达式(而且要去掉括号)。
表达式
expression1 | expression2 | ... | expressionN* R- s: |- P/ n& m9 C
命令行 及 选项 使用大写或小写字母都可以。
首个命令行必须是无选项的参数变量。
选项及其它文件名的输入顺序可以打乱。
带有空格的通配符或文件名必须加上引号:
"Dir\Program files\*"+ r+ u2 k   b' Z& U. n
Dir\"Program files"\*. M   R   V3 S/ s
通配符是一个键盘字符,例如星号(*)或问号(?),当执行添加文件、释放文件、选定文件、删除文件等操作时,您可以使用它来代表一个或多个字符。当您不知道真正字符或者不想键入完整名称时,常常使用通配符代替一个或多个字符。
7-Zip 支持和 Windows 相类似的通配符:
“*”可以使用星号代替零个或多个字符。
“?”可以用问号代替名称中的单个字符。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值