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

How to unzip a file using unzip command

Jan 23, 2019 pm 04:43 PM

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!

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

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Tutorial on finding keywords for common Linux commands Tutorial on finding keywords for common Linux commands Mar 05, 2025 am 11:45 AM

Tutorial on finding keywords for common Linux commands

Work content of Linux operation and maintenance engineers What does Linux operation and maintenance engineers do? Work content of Linux operation and maintenance engineers What does Linux operation and maintenance engineers do? Mar 05, 2025 am 11:37 AM

Work content of Linux operation and maintenance engineers What does Linux operation and maintenance engineers do?

How do I configure SELinux or AppArmor to enhance security in Linux? How do I configure SELinux or AppArmor to enhance security in Linux? Mar 12, 2025 pm 06:59 PM

How do I configure SELinux or AppArmor to enhance security in Linux?

How do I back up and restore a Linux system? How do I back up and restore a Linux system? Mar 12, 2025 pm 07:01 PM

How do I back up and restore a Linux system?

Methods for uploading files for common Linux commands Methods for uploading files for common Linux commands Mar 05, 2025 am 11:42 AM

Methods for uploading files for common Linux commands

How do I monitor system performance in Linux using tools like top, htop, and vmstat? How do I monitor system performance in Linux using tools like top, htop, and vmstat? Mar 17, 2025 pm 05:28 PM

How do I monitor system performance in Linux using tools like top, htop, and vmstat?

How do I configure a virtual private network (VPN) in Linux using OpenVPN or WireGuard? How do I configure a virtual private network (VPN) in Linux using OpenVPN or WireGuard? Mar 12, 2025 pm 07:02 PM

How do I configure a virtual private network (VPN) in Linux using OpenVPN or WireGuard?

How do I implement two-factor authentication (2FA) for SSH in Linux? How do I implement two-factor authentication (2FA) for SSH in Linux? Mar 17, 2025 pm 05:31 PM

How do I implement two-factor authentication (2FA) for SSH in Linux?

See all articles