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

Vue Virtual DOM Quick Start

Table of contents Virtual DOM What is virtual dom...

Good website copywriting and good user experience

Looking at a website is actually like evaluating a...

MySQL 5.7.21 Installer Installation Graphic Tutorial under Windows 10

Install MySQL and keep a note. I don’t know if it...

MySQL encryption and decryption examples

MySQL encryption and decryption examples Data enc...

Implementation of ssh non-secret communication in linux

What is ssh Administrators can log in remotely to...

CentOS method to modify the default ssh port number example

The default ssh port number of Linux servers is g...

Detailed Introduction to Nginx Installation and Configuration Rules

Table of contents 1. Installation and operation o...

A brief discussion on the design and optimization of MySQL tree structure tables

Preface In many management and office systems, tr...

Mysql query the most recent record of the sql statement (optimization)

The worst option is to sort the results by time a...

Methods to enhance access control security in Linux kernel

background Some time ago, our project team was he...