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

How to unzip a file using unzip command

不言
Release: 2019-01-23 16:43:29
Original
8771 people have browsed it

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 目标文件
Copy after login

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
Copy after login

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
Copy after login

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
Copy after login

-l Confirm the contents of the compressed file

$ unzip -l test.zip
Copy after login

Use -t to test whether it can be decompressed normally

$ unzip -t test.zip
Copy after login
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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template