Detailed explanation of Linux command unzip

Detailed explanation of Linux command unzip

1. unzip command

The unzip command is used to decompress the ".zip" compressed package compressed by the zip command.

1.1 Syntax

unzip(options)(parameters)

1.2 Options

Options describe
-c Display the decompressed result on the screen and perform appropriate character conversion;
-f Update existing files;
-l Display the files contained in the compressed file;
-p Similar to the -c parameter, the decompression results will be displayed on the screen, but no conversion will be performed;
-t Check whether the compressed file is correct;
-u Similar to the -f option, but in addition to updating existing files, it will also extract other files in the compressed file into the directory;
-v Display detailed information during execution;
-z Only display the comment text of the compressed file;
-a Perform necessary character conversion on text files;
-b Do not perform character conversion on text files;
-C File names within compressed files are case-sensitive;
-j The original directory path in the compressed file is not processed;
-L Change all file names in the compressed file to lowercase;
-M Send the output results to the more program for processing;
-n Do not overwrite the original files when decompressing;
-o No need to ask the user first, unzip will overwrite the original file after execution;
-P<password> Use the password option of zip;
-q No information is displayed during execution;
-s Convert blank characters in file names to underscore characters;
-V Keep the file version information of VMS;
-X When decompressing, restore the original UID/GID of the file;
-d <directory> Specify the directory where the files will be stored after decompression;
-x <file> Specify which files in the .zip archive should not be processed;
-Z unzip -Z is equivalent to executing the zipinfo command.

2. Example

unzip test.zip -> unzip test.zip to the current file unzip -n test.zip -d /tmp -> unzip test.zip to the /tmp directory and do not overwrite existing files unzip -v test.zip -> view the contents of test.zip but do not unzip it unzip -o test.zip -d tmp/ -> unzip test.zip to the /tmp directory and overwrite existing files

This concludes this article on the detailed explanation of the Linux command unzip. I hope it will be helpful for everyone’s study, and I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • How to decompress multiple files using the unzip command in Linux
  • Detailed explanation of zip compression and unzip decompression commands and their usage in Linux
  • Solution to Chinese garbled characters when unzipping in Linux

<<:  Pure CSS and Flutter realize breathing light effect respectively (example code)

>>:  Methods of adaptive web design (good access experience on mobile phones)

Recommend

Docker uses Supervisor to manage process operations

A Docker container starts a single process when i...

SQL ROW_NUMBER() and OVER() method case study

Syntax format: row_number() over(partition by gro...

Detailed explanation of Vue two-way binding

Table of contents 1. Two-way binding 2. Will the ...

Vue+ElementUI implements paging function-mysql data

Table of contents 1. Problem 2. Solution 2.1 Pagi...

Linux Check the installation location of the software simple method

1. Check the software installation path: There is...

JavaScript flow control (branching)

Table of contents 1. Process Control 2. Sequentia...

A brief discussion on the use and analysis of nofollow tags

Controversy over nofollow There was a dispute bet...

React implements dynamic pop-up window component

When we write some UI components, if we don't...

Sample code for programmatically processing CSS styles

Benefits of a programmatic approach 1. Global con...

A few steps to easily build a Windows SSH server

The SSH mentioned here is called Security Shell. ...

Mysql aggregate function nested use operation

Purpose: Nested use of MySQL aggregate functions ...

VMware WorkStation 14 pro installation Ubuntu 17.04 tutorial

This article records the specific method of insta...

Let's talk about the difference between MyISAM and InnoDB

The main differences are as follows: 1. MySQL use...

How to change the system language of centos7 to simplified Chinese

illustrate When you install the system yourself, ...