`
iihero
  • 浏览: 249583 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

7zip命令行用法

阅读更多
7zip功能很强大,你只要两个文件:
7z.exe以及7z.dll就可以使用命令行工作了。

Usage: 7za <command> [<switches>...] <archive_name> [<file_names>...]
       [<@listfiles...>]

1. "a",添加文件
7z a -t7z files.7z *.txt

2. "d", 删除文件
7z d archive.zip *.bak -r
从zip文件中删除所有的*.bak文件

3. "e", 解压缩
7z e archive.zip

4. "l", 列出文件
7z l archive.zip

5. "t", 测试完整性
7z t archive.zip *.doc -r

6. "u", 更新
7z u archive.zip *.d

7. "x", 与e相同,但保留全路径

8. "m", 指定优化级别
Compression switch: -mx0
What it means:      Don't compress at all.
    Is called "copy mode."

Compression switch: -mx1
What it means:      Very low compression.
    It is called "fastest" mode.

Compression switch: -mx3
What it means:      Fast compression mode.
    Will set various parameters automatically.

Compression switch: -mx5
What it means:      Same as above, but "normal."

Compression switch: -mx7
What it means:      "maximum" compression.

Compression switch: -mx9
What it means:      "ultra" compression.
    (You probably want to use this.)

9. "-m"选项:
Switch:   -mfb
Function: Specifies # of fast bytes.
  Sometimes help with very "sparse" files.
  Don't bother.

Switch:   -mpass
Function: Number of passes for deflate compression.
  Don't bother with this.
  Automatically set with levels.

Switch:   -md
Function: Specifies dictionary size.
  Automatically set, so don't bother.

Switch:   -mmt
Function: Enable multithreading.
  Use if: you have quad-core and a really huge archive.
  Specify "on" or "off".
  This may be enabled by default; check the help file.

10. "-t"选项
指定压缩文件类型
Type switch:      -t7z
Format:           7Z
Example filename: archive.7z (default option)

Type switch:      -tgzip
Format:           GZIP
Example filename: archive.gzip
  archive.gz

Type switch:      -tzip
Format:           ZIP
Example filename: archive.zip (very compatible)

Type switch:      -tbzip2
Format:           BZIP2
Example filename: archive.bzip2

Type switch:      -ttar
Format:           TAR
Example filename: tarball.tar (UNIX and Linux)

Type switch:      -tiso
Format:           ISO
Example filename: image.iso

Type switch:      -tudf
Format:           UDF
Example filename: disk.udf

7z a -tiso archive.iso
7z a -tudf archive.udf

7z:                         executable name
a:                          add to archive
-tiso or -tudf:             format of archive to create
archive.iso or archive.udf: name of archive to create

10. 硬压缩
Switch:   -ms=on
Function: Enable solid mode.
This is the default so you won't often need this.

Switch:   -ms=off
Function: Disable solid mode.
This is useful when you need to update individual files.
Will reduce compression ratios normally.

11. "-p"设定密码
7z a pw.7z *.txt -pSECRET

12. 其它选项:
Switch:   -ssc
Function: Specify case-sensitive mode.
  Useful for going between Linux and Windows.
  Default: -ssc- on Windows (insensitive)
  Default: -scc on Linux (sensitive)


Switch:   -ssw
Function: Compress locked files.
  Use if: you have problems with opening files.

Switch:   -w
Function: Set working directory.
  Use when you want to specify temp folders.

Switch: -aoa
Overwrite all destination files.

Switch: -aos
Skip over existing files without overwriting.
Use this for files where the earliest version is most important.

Switch: -aou
Avoid name collisions.
New files extracted will have a number appending to their names.
(You will have to deal with them later.)

Switch: -aot
Rename existing files.
This will not rename the new files, just the old ones already there.
Use when the new files are more important.

7z x test.zip -aoa

7z:       use the 7-zip executable
x:        use the extract command
test.zip: extract files from this archive
-aoa:     overwrite all existing files. risky!

1
1
分享到:
评论

相关推荐

    7-zip命令行说明(htm文档)

    7-zip命令行用法的中文说明 PS:特别详细,附带示例

    Windows下的命令行使用的zip命令

    Windows下的命令行使用的zip命令,用法与linux用法一致。 后端程序打包文件调用。 如果你装了windows版的Oracle,那你可以在Oracle\product\11.2.0\dbhome_1\BIN目录下找到该zip命令。

    命令行程序转GUI程序Gooey.zip

    Gooey 使用命令行程序来呈现用户,尤其是 rank-and-file 用户是减少其使用的最快方法之一。 Gooey 论证了 argparse 命令行解析库期望的参数,并把它们作为 GUI 形式呈现给用户,所有选项都使用适当的控件(例如多...

    Windows终端配置zip、unzip命令

    一、GIT终端 将zip.exe 、unzip.exe放到Git的bin目录下,就可以在Git终端(Git Bash ...三、使用方法 解压缩命令:unzip xxx.zip (将xxx.zip解压缩) 压缩命令:zip -q -r xxx.zip yyy (将yyy文件压缩成xxx.zip文件)

    blat.zip Windows命令行SMTP邮件程序 内有调用shell

    blat3222 Blat-Windows命令行SMTP邮件程序 小巧的实用命令行工具。使用方法可参见我的博客 附带批处理命令 https://blog.csdn.net/ilqgffvramusm2864/article/details/106332050

    7z-sfx-builder 自解压格式exe

    所谓 7z SFX 是7ZIP的自解压模块,用于可生成自解压形式的exe可执行文件。...8、使用不同的方法压缩(LZMA,LZMA2,Deflate,PPMD),它提供存档7-Zip的压缩档案; 9、支持文件自解压文件后删除单个文件。

    Inquirer.js, 通用交互 命令行 用户界面的集合.zip

    Inquirer.js, 通用交互 命令行 用户界面的集合 Inquirer.js 通用交互 命令行 用户界面的集合。版本 4.x 只支持 node 6和 over 。 对于 node 4支持,请使用版本 3.x 。目录文档文档安装工具示例方法对象问题回答分

    在服务器上解zip包的php程序

    包内有两个文件 zip.class.php zip1.php 不需要zip库的支持,任何地方可用 用法: 把zip 文件比如说foo.zip与这两个文件上传到服务器 ...支持命令行使用 欢迎到 codebase.hualiuliu.com 贴上好的程序

    跨平台360云盘命令行工具(360云盘备份)360yunpan.zip

    用法: ./cli.py -o http://xxx.com/xxx.tar.gz  例子:  开始离线下载  ./cli.py -o http://xxx.com/xxx.tar.gz  ./cli.py --offline="http://xxx.com/xxx.tar.gz"  -h, --help 查看帮助  -o, --...

    zip_files:用于创建zip文件的命令行实用程序

    用于创建zip文件的命令行实用程序。 提供zip-files和zip-folder命令行实用程序。 它们旨在作为一种独立于平台的简便工具,从文件系统上任意位置的文件和文件夹创建具有任意文件名和任意根(提取zip后的顶层文件夹...

    Windows终端配置zip、unzip 命令

    Windows终端配置zip、unzip 和linux ... 打开cmd终端,即可使用zip、unzip命令 #方法二 把 zip.exe 和unzip.exe文件复制到目录中 C:\Program Files\Git\mingw64\bin 重新打开终端Git Bash zip -hellp 预祝你的成功!

    sonic-pi-cli, 在 ruby 中,一个简单的命令行 接口,用于.zip

    sonic-pi-cli, 在 ruby 中,一个简单的命令行 接口,用于 sonic-pi-cliruby 接口的简单 命令行 接口,用编写。需要 Sonic v2.7或者更高的 。安装gem install sonic-pi-cli用法声波Pi必须运行,因为这只是一个客户端...

    7-zip 中文版(解压软件) v9.33 多语官方版.exe

    对于 ZIP 及 GZIP 格式,7-Zip 能提供比使用 PKZip 及 WinZip 高 2-10% 的压缩比 为 7z 与 ZIP 提供更完善的 AES-256 加密算法 7z 格式支持创建自释放(SFX)压缩包 Windows 资源管理器集成 强大的的文件管理器 ...

    pushbullet-cli, 从 命令行 访问 Pushbullet.zip

    pushbullet-cli, 从 命令行 访问 Pushbullet Pushbullet CLI接口 安装$ pip install pushbullet-cli用法从 命令行 中使用 Pushbullet 。首先,通过运行以下命令设置你的API密钥: $ p

    HCIA-openEuler V1.0视频.zip

    2.1 Linux命令行基础 .zip 2.2 目录操作、文件操作和查看操作 .zip 2.3 分页查看操作和查找操作 .zip 2.4 压缩和打包操作 .zip 3.1 常见文本编辑器 .zip 3.2 如何使用VIM编辑器 .zip 3.3 在Linux查看文件-cat、more...

    topdoc, 在css注释中,用于生成基于文档的用法文档的命令行 工具.zip

    topdoc, 在css注释中,用于生成基于文档的用法文档的命令行 工具 Topdoc 使用 css block 注释为html组件生成用法和样式指南的工具。快速介绍通过向css添加 Topdoc block,可以描述 html/css组件,该信息可以用于生成...

    gulp-shell, 方便的命令行 接口用于吞咽.zip

    gulp-shell, 方便的命令行 接口用于吞咽 gulp 方便的命令行 接口用于吞咽安装npm install --save-dev gulp-shell用法const gulp = require('gulp')const shel

    wwdc, 用于访问WWDC会话内容的命令行 接口.zip

    wwdc, 用于访问WWDC会话内容的命令行 接口 WWDC为访问WWDC会话内容的命令行界面提供英镑ASCIIwwdc 提供WWDC内容的可以搜索全文文本。 wwdc 构建在它的API上,在项目的README中记录了它。安装$ gem install wwdc用法...

    HashData, 一个 命令行 散列识别工具.zip

    HashData, 一个 命令行 散列识别工具 HashData用于哈希。编码和加密标识的REPL 。 这些列表并不完整,并且通常会给每个输入提供很多可以能性,因为一种类似的函数 Having 输出。 安装$ gem install hashdata用法

    rust-argparse, Rust的命令行 参数解析器库.zip

    rust-argparse, Rust的命令行 参数解析器库 Argparserust-argparse的Rust 命令行解析模块。 它受到 python 模块 argparse的启发。功能:支持标准( GNU ) 选项约定正确输入的值自动生成的帮助和用法消息导入编辑 ...

Global site tag (gtag.js) - Google Analytics