<p>The following examples illustrate typical uses of the command <a href="https://www.lifewire.com/examples-linux-unzip-command-2201157" data-component="link" data-source="inlineLink" data-type="internalLink" data-ordinal="1">unzip</a> for unpackaging &#34;archive&#34; files, also called &#34;zip files&#34;. The archive files are assumed to be generated <a data-inlink="XnlQ6xnqSrNJcP6WMpeYTQ&#61;&#61;" href="https://www.lifewire.com/how-to-unzip-zip-files-2483209" data-component="link" data-source="inlineLink" data-type="internalLink" data-ordinal="2">using software</a> such as zip, which uses the standard zip file format.<br/><br/>To use <em>unzip</em> to extract all members of the archive <em>letters.zip</em> into the current directory and subdirectories below it, creating any subdirectories as necessary:</p><p> </p><pre> <code> unzip letters </code></pre><p>To extract all members of <em>letters.zip</em> into the current directory only:</p><p> </p><pre> <code> unzip -j letters </code></pre><p>To test <em>letters.zip</em>, printing only a summary message indicating whether the archive is OK or not:</p><p> </p><pre> <code> unzip -tq letters </code></pre><p>To test <em>all</em> zipfiles in the current directory, printing only the summaries:</p><p> </p><pre> <code> unzip -tq \*.zip </code></pre><p>(The backslash before the asterisk is only required if the shell expands wildcards, as in Unix; double quotes could have been used instead, as in the source examples below.) To extract to standard output all members of <em>letters.zip</em> whose names end in <em>.tex</em>, auto-converting to the local end-of-line convention and piping the output into <em><a href="https://www.lifewire.com/what-to-know-more-command-4051953" data-component="link" data-source="inlineLink" data-type="internalLink" data-ordinal="3">more</a></em>(1):</p><p> </p><pre> <code> unzip -ca letters \*.tex | more </code></pre><p>To extract the binary file <em>paper1.dvi</em> to standard output and pipe it to a printing program:</p><p> </p><pre> <code> unzip -p articles paper1.dvi | dvips </code></pre><p>To extract all FORTRAN and C source files--*.f, *.c, *.h, and Makefile--into the /tmp directory:</p><p> </p><pre> <code> unzip source.zip &#34;*.[fch]&#34; Makefile -d /tmp </code></pre><p>(the double quotes are necessary only in Unix and only if globbing is turned on). To extract all FORTRAN and C source files, regardless of case (e.g., both *.c and *.C, and any makefile, Makefile, MAKEFILE or similar):</p><p> </p><pre> <code> unzip -C source.zip &#34;*.[fch]&#34; makefile -d /tmp </code></pre><p>To extract any such files but convert any uppercase MS-DOS or VMS names to lowercase and convert the line-endings of all of the files to the local standard (without respect to any files that might be marked &#96;&#96;binary&#39;&#39;):</p><p> </p><pre> <code> unzip -aaCL source.zip &#34;*.[fch]&#34; makefile -d /tmp </code></pre><p>To extract only newer versions of the files already in the current directory, without querying (NOTE: be careful of unzipping in one timezone a zipfile created in another--<a data-inlink="92ZmZRB4N6zj7rxYqMWn6g&#61;&#61;" href="https://www.lifewire.com/practical-examples-of-the-zip-command-2201158" data-component="link" data-source="inlineLink" data-type="internalLink" data-ordinal="4">ZIP archives</a> other than those created by Zip 2.1 or later contain no timezone information, and a &#96;&#96;newer&#39;&#39; file from an eastern timezone may, in fact, be older):</p><p> </p><pre> <code> unzip -fo sources </code></pre><p>To extract newer versions of the files already in the current directory and to create any files not already there (same caveat as previous example):</p><p> </p><pre> <code> unzip -uo sources </code></pre><p>To display a diagnostic screen showing which <em>unzip</em> and <em>zipinfo</em> options are stored <a data-inlink="DljG-23GlO8I-UE7zfNuMg&#61;&#61;" href="https://www.lifewire.com/operating-systems-unix-vs-windows-2180225" data-component="link" data-source="inlineLink" data-type="internalLink" data-ordinal="5">in environment variables</a>, whether decryption support was compiled in, the compiler with which <em>unzip</em> was compiled, etc.:</p><p> </p><pre> <code> unzip -v </code></pre><p>In the last five examples, assume that UNZIP or UNZIP_OPTS is set to -q. To do a singly quiet listing:</p><p> </p><pre> <code> unzip -l file.zip </code></pre><p>To do a doubly quiet listing:</p><p> </p><pre> <code> unzip -ql file.zip </code></pre><p>(Note that the &#96;&#96;.zip&#39;&#39; is generally not necessary.) To do a standard listing:</p><p> </p><pre> <code> unzip --ql file.zip </code></pre><p>or</p><pre> <code> unzip -l-q file.zip </code></pre><p>or</p><pre> <code> unzip -l--q file.zip </code></pre><p>(Extra minuses in options don&#39;t hurt.)<br/><br/>Complete syntax of the command: zip<br/><a href="https://www.lifewire.com/examples-linux-unzip-command-2201157" data-component="link" data-source="inlineLink" data-type="internalLink" data-ordinal="6">Complete syntax of the command: unzip</a></p>