查看帮助:
1、命令 -- help
2、man 命令
后者更加详细
首先帮助中尖括号<>和方括号[]以及省略号...的含义,
在方括号内的表达式(“[” 和 “]”之间的字符)是可选的(写命令时要去掉括号)。
在尖括号内的表达式(“<” 和 “>”之间的字符)是必须替换的表达式(而且要去掉括号)。
省略号表示该选项可以单个或多个
以7z的参数为例:
7z <command> [<switches>...] <archive_name> [<file_names>...] [<@listfiles...>]
7z <命令行> [[选项]...] <档案名称(压缩包名称)> [<被压缩的文件名>...] [<@文件列表(如txt文件中的文件列表)...>]
实例分析:
7z a -tzip -p111 archive.zip txt.txt txt.txt文件压缩为archive.zip,压缩方式为zip 密码为111
7z x -tzip -p111 archive.zip 解压 密码为111
a为命令,命令至少要有一个
-t /-p为选项(switch),可选0个或多个,zip和111分别为-t和-p的参数,中间不需要空格 选项(如-r)放前放后都行
7z的命令不区分大小写,有些命令如cp要区分。。。注意了
<Commands>
a: Add files to archive 添加文件到压缩包中
b: Benchmark
d: Delete files from archive 从压缩包中删除文件
e: Extract files from archive (without using directory names) 从压缩档案中释放文件到当前目录中。或者到指定的输出文件夹。输出文件夹设置可以通过 -o (设置输出文件夹) 选项来更改。
l: List contents of archive 查看压缩包中文件列表
t: Test integrity of archive
u: Update files to archive
x: eXtract files with full paths 在当前目录中,使用完整路径从压缩档案中释放文件.或者到指定的输出文件夹。更多详细内容请参阅 e (释放) 命令。
示例
7z x archive.zip
从压缩档案 archive.zip 中释放所有文件到当前文件夹。
7z x archive.zip -oc:\soft *.cpp
从压缩档案 archive.zip 中释放 *.cpp 文件到 c:\soft 文件夹。