Home > Hosting > Server

What is the command to decompress the zip package in linux

2023-02-05 11:11:55

<p style="text-align: left;">The editor in this article will introduce in detail which command is used to decompress the zip package in linux. The idea of editing is slowly deepening, let&#39;s learn new knowledge together.</p><p><br/></p><blockquote><p style="text-align: left;">The command to decompress the zip package in Linux is unzip. The unzip command is used to view and decompress zip files. It can list, test and extract compressed files in ZIP archives. The syntax format is unzip [option] compressed package name; common option parameters are -d directory name, -n, -o, -v, -t, -x List of files.</p></blockquote><p style="text-align: left;"><strong>Linux unzip command: Unzip zip files</strong></p><p style="text-align: left;">The unzip command is used to view and decompress zip files, you can list, test and extract ZIP Compressed file in archive;</p><p style="text-align: left;"><strong>Command Syntax</strong></p><p style="text-align: left;"><code>unzip [options] archivename</code></p><p><br/></p><p style="text-align: left;">The commonly used options of this command and their meanings are shown in Table 1.</p><table style="text-align: left;"><caption>Table 1 Common options and meanings of unzip command</caption><tbody><tr class="firstRow"><td>Option</td><td>Meaning</td></tr><tr><td>-d directory name</td><td>Decompress the compressed file to the specified directory.</td></tr><tr><td>-n</td><td>Do not overwrite existing files when decompressing.</td></tr><tr><td>-o</td><td>Overwrite existing files when decompressing without user confirmation.</td></tr><tr><td>-v</td><td>View the detailed information of the compressed file, including the file size, file name and compression ratio contained in the compressed file, but does not Unzip operation.</td></tr><tr><td>-t</td><td>Test the compressed file for damage, but do not decompress it.</td></tr><tr><td>-x filelist</td><td>Extract files without the files specified in the filelist.</td></tr></tbody></table><p style="text-align: left;"><strong>Command Example</strong></p><p style="text-align: left;">1、<code>unzip test5.zip</code> decompress File test5.zip to the current directory;</p><p><img src="//img.freeonlinedomain.com/uploads/allimg/20230207/1-23020G11H5516.jpg" title="" alt="2.jpg"/></p><p style="text-align: left;">2, <code>unzip -l test5.zip</code><strong> </strong></p><p style="text-align: left;"><strong>-l</strong> means to view the files in the compressed file without decompression;&lt; /p&gt;</p><p><img src="//img.freeonlinedomain.com/uploads/allimg/20230207/1-23020G11K4336.jpg" title="" alt="QQ截图20230207111605.jpg"/></p><p style="text-align: left;">3、<code>unzip -v test5.zip</code> </p><p style="text-align: left;"><strong>-v</strong> Indicates that in the case of no decompression View the files in the compressed file, and display more information (compression ratio, etc.);</p><p><br/></p><p style="text-align: left;">4, <code>unzip -q test.zip</code></p><p style="text-align: left;"><strong>-q</strong> means do not display the execution process;</p><p style="text-align: left;"><br/></p><p style="text-align: left;"><code>[root@localhost data]# unzip -q test.zip</code></p><p><br/></p><p style="text-align: left;">5, <code>unzip -o test.zip</code> </p><p style="text-align: left;"><strong>-o</strong> means not asking the user, overwriting the original file;</p><p><br/></p><p style="text-align: left;">6, <code>unzip -q -d /data/test/test5 test.zip</code> (<code>unzip -q test.zip - d /data/test/test5</code>)</p><p style="text-align: left;"><strong>-d</strong> Indicates the directory where the specified file will be stored after decompression (the path must be followed by -d, otherwise an error will be reported, And when the path does not exist, it will be created automatically);</p><p><br/></p><p style="text-align: left;"><br/></p>


Copyright Description:No reproduction without permission。

Knowledge sharing community for developers。

Let more developers benefit from it。

Help developers share knowledge through the Internet。

Follow us