7z压缩与解压命令
在写很多工具的时候,可能会用到7z命令来进行压缩与解压操作。这里记录二个比较常用的操作:压缩、解压。
在dos窗口下输入7z命令,会显示7z的使用参数详情:
7-Zip 9.10 beta Copyright (c) 1999-2009 Igor Pavlov 2009-12-22
Usage: 7z <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
必选参数:最常用的命令有a(压缩)、x(解压),其它的命令诸如删除,解压出来不保留目录结构这种,一般情况下都用不到。
可选参数:最常用的就是-t{Type}
Type默认值为7z,还有其它的如:
| Type | Format | Example filename |
| -t7z | 7Z | archive.7z(默认) |
| -tgzip | GZIP | archive.gzip,archive.gz |
| -tzip | ZIP | archive.zip(兼容) |
| -tbzip2 | BZIP2 | archive.bzip2 |
| -ttar | TAR | tarball.tar(Unix/Linux) |
| -tiso | ISO | image.iso(可能不支持) |
| -tudf | UDF | disk.udf |
常用的就是-t{Type}以及-r、-o、-y
解压命令:7z x -tzip -y xx-13.zip (解压到当前目录,如需改变输出目录,需要附加使用-o)
压缩命令:7z a -tzip -r xx.zip a\* b\*
将目录a、目录b,压缩成一个xx.zip
更多参数的详情,可以参考这里:http://www.dotnetperls.com/7-zip-examples

在Windows的64位操作系统下,除需要7z.exe外,还需要7z.dll,我将他们打包为一个zip文件,否则你执行命令的时候可能会遇到上面的错误。你可以从这里直接下载>>
7z压缩与解压命令的更多相关文章
- 【Linux命令】Linux压缩及解压命令
Linux压缩及解压命令 一.文件打包和压缩命令介绍 linux系统文件压缩格式,常用的有*.tar.gz.*.gz.*.zip.*.tar,还有*.rar..7z..bz2..tar.xz..tar ...
- linux的 压缩与解压 命令集
bzip2压缩费时但效果好,而且支持hadoop的hdfs文件切分,gzip不行 bzip2 [-cdz] 文件名 -c :将压缩的过程输出到屏幕 -d :解压缩 -z :压缩 -# :压缩比的参数, ...
- Linux 压缩、解压命令使用
tar在Linux上是常用的打包.压缩.加压缩工具,他的参数很多,这里仅仅列举常用的压缩与解压缩参数 参数: -c :create 建立压缩档案的参数:(个人理解也就是打包) -x : 解压缩压缩档案 ...
- linux 压缩以及解压命令
转载:http://blog.csdn.net/mmllkkjj/article/details/6768294/ tar-c: 建立压缩档案-x:解压-t:查看内容-r:向压缩归档文件末尾追加文件- ...
- Linux 下文件压缩与解压命令详解
tar 命令 -c 建立压缩档案 -x 解压 -t 查看内容 -r 向压缩归档文件末尾追加文件 -u 更新原压缩包中的文件 这五个是独立的命令,压缩解压都要用到其中一个,可以和别的命令连用但只能用其中 ...
- Linux文件压缩与解压命令
1 .zip 格式压缩与解压 压缩命令 zip 压缩文件名 源文件 zip -r 压缩目录名 源目录 解压命令 unzip 文件名 td@td-Lenovo-IdeaPad-Y41 ...
- 【Linux】CentOS tar压缩与解压命令大全
tar命令详解 -c: 建立压缩档案 -x:解压 -t:查看内容 -r:向压缩归档文件末尾追加文件 -u:更新原压缩包中的文件 这五个是独立的命令,压缩解压都要用到其中一个,可以和别的命令连用但只能用 ...
- linux中常用压缩与解压命令
一. tar文件的解压 tar -xvf db.tar 二. zip文件的压缩与解压 压缩 zip -r dest_name.zip directory_to_compress 解压 unzip de ...
- ubuntu 各压缩文件解压命令大全
.tar 解包:tar xvf xxx.tar 打包:tar cvf xxx.tar DirName (注:tar是打包,不是压缩!) .gz 解压1:gunzip FileName.gz 解压2:g ...
随机推荐
- python生成器、装饰器、正则
包子来了[4],被[mayun]吃了! 包子来了[4],被[mahuateng]吃了! 做了两个包子 包子来了[5],被[mayun]吃了! 包子来了[5],被[mahuateng]吃了! 做了两个包 ...
- AJAX请求时status返回状态明细表(转)
转自:http://www.cnblogs.com/wangking/p/6530904.html AJAX请求时status返回状态明细表 readyState的五种状态2010-03-04 18: ...
- thinkphp AOP(面向切面编程)
AOP: 在软件业,AOP为Aspect Oriented Programming的缩写,意为:面向切面编程,通过预编译方式和运行期动态代理实现程序功能的统一维护的一种技术.AOP是OOP的延续,是软 ...
- 如何安装pycharm
Ubuntu系统安装PyCharm教程(详细图文) 参考(http://jingyan.baidu.com/article/60ccbceb4e3b0e64cab19733.html)
- 【BZOJ】2120: 数颜色
题解 练习一下带修改莫队 先按照左端点的块排序,再按照右端点的块排序,然后按照时间排序 每个修改操作存一下修改前这个位置的值就可以逆序操作了 代码 #include <bits/stdc++.h ...
- vs2010添加头文件与库文件搜索目录
1 添加头文件搜索目录 项目属性->配置属性->C/C++->常规->添加包含目录 2 添加库文件搜索 项目属性->配置属性->VC++目录->库目录
- Github如何撤销提交并清除痕迹
1.在命令行工具中进入项目目录 cd /Users/mac.manon/workspace/QuickCodes 2.sudo git reset --hard HEAD~4 根据提示输入本系统登录密 ...
- matplotlib显示中文异常处理
matplotlib显示中文 [做个记录,方便以后使用] [一般导入方式] import matplotlib.pyplot as plt [效果图] [方式一]FontProperties impo ...
- js变量和函数声明的提升(转)
原文:http://zha-zi.iteye.com/blog/2037026 下面的程序是什么结果? var foo = 1; function bar() { if (!foo) { var fo ...
- 20172301 《Java软件结构与数据结构》实验三报告
20172301 <Java软件结构与数据结构>实验三报告 课程:<Java软件结构与数据结构> 班级: 1723 姓名: 郭恺 学号:20172301 实验教师:王志强老师 ...