2019-04-21 11:50:48 +08:00

44 lines
2.6 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<h1 id="unzip">unzip</h1>
<p>用于解压缩由zip命令压缩的压缩包</p>
<h2 id="补充说明">补充说明</h2>
<p><strong>unzip命令</strong> 用于解压缩由zip命令压缩的“.zip”压缩包。</p>
<h3 id="语法">语法</h3>
<pre><code class="language-bash">unzip(选项)(参数)</code></pre>
<h3 id="选项">选项</h3>
<pre><code class="language-bash">-c将解压缩的结果显示到屏幕上并对字符做适当的转换
-f更新现有的文件
-l显示压缩文件内所包含的文件
-p与-c参数类似会将解压缩的结果显示到屏幕上但不会执行任何的转换
-t检查压缩文件是否正确
-u与-f参数类似但是除了更新现有的文件外也会将压缩文件中的其他文件解压缩到目录中
-v执行时显示详细的信息
-z仅显示压缩文件的备注文字
-a对文本文件进行必要的字符转换
-b不要对文本文件进行字符转换
-C压缩文件中的文件名称区分大小写
-j不处理压缩文件中原有的目录路径
-L将压缩文件中的全部文件名改为小写
-M将输出结果送到more程序处理
-n解压缩时不要覆盖原有的文件
-o不必先询问用户unzip执行后覆盖原有的文件
-P&lt;密码&gt;使用zip的密码选项
-q执行时不显示任何信息
-s将文件名中的空白字符转换为底线字符
-V保留VMS的文件版本信息
-X解压缩时同时回存文件原来的UID/GID
-d&lt;目录&gt;:指定文件解压缩后所要存储的目录;
-x&lt;文件&gt;:指定不要处理.zip压缩文件中的哪些文件
-Zunzip-Z等于执行zipinfo指令。</code></pre>
<h3 id="参数">参数</h3>
<p>压缩包:指定要解压的“.zip”压缩包。</p>
<h3 id="实例">实例</h3>
<p>将压缩文件text.zip在当前目录下解压缩。</p>
<pre><code class="language-bash">unzip test.zip</code></pre>
<p>将压缩文件text.zip在指定目录<code>/tmp</code>下解压缩如果已有相同的文件存在要求unzip命令不覆盖原先的文件。</p>
<pre><code class="language-bash">unzip -n test.zip -d /tmp</code></pre>
<p>查看压缩文件目录,但不解压。</p>
<pre><code class="language-bash">unzip -v test.zip</code></pre>
<p>将压缩文件test.zip在指定目录<code>/tmp</code>下解压缩如果已有相同的文件存在要求unzip命令覆盖原先的文件。</p>
<pre><code class="language-bash">unzip -o test.zip -d tmp/</code></pre>
<!-- Linux命令行搜索引擎https://jaywcjlove.github.io/linux-command/ -->