Home  >  Article  >  Operation and Maintenance  >  How to unzip a file using unzip command

How to unzip a file using unzip command

不言
不言Original
2019-01-23 16:43:298714browse

The unzip command is used to expand documents compressed in zip format. In this article, we will introduce the specific method of using unzip to decompress files under Linux.

How to unzip a file using unzip command

#ZIP format files are a compression format, usually used to compress directories and multiple files, and the extension of ZIP compressed files is ".zip".

ZIP is a compression format used not only on Linux but also on various operating systems such as Windows and Mac.

The unzip command is written as follows

$ unzip 目标文件

Basically, if a zip file is specified as a parameter, the file will be expanded.

Selection of unzip command

##Selection of commandDescription-c Run-time output result-dSpecify and expand the directory -l Confirm the contents of the compressed file -t Test whether it can be decompressed normally

How to use the unzip command

We will use the unzip command to unzip the document "test.zip".


$ unzip test.zip

If the file exists when expanding, it will be displayed as follows.

$ replace test/test1.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: n

Specify the directory when using -d to decompress

If you want to use the unzip command to expand the ZIP file in the specified directory, please use the "-d" option.

The following is the unzipped document in the directory tmp.

$ unzip -d tmp test.zip

-l Confirm the contents of the compressed file

$ unzip -l test.zip

Use -t to test whether it can be decompressed normally

$ unzip -t test.zip

If No errors are detected in the compressed data of "test.zip" and it can be decompressed normally.

The above is the detailed content of How to unzip a file using unzip command. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:How to use bash commandsNext article:How to use bash commands