Home  >  Article  >  Operation and Maintenance  >  What is the command to decompress a zip package in Linux?

What is the command to decompress a zip package in Linux?

青灯夜游
青灯夜游Original
2023-02-01 18:00:5597891browse

The Linux command to decompress a zip package is "unzip". The unzip command is used to view and decompress zip files. It can list, test and extract compressed files in ZIP archives. The syntax format is "unzip [option] compressed package name"; common option parameters include "-d directory name", "- n", "-o", "-v", "-t", "-x file list".

What is the command to decompress a zip package in Linux?

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

Linux unzip command: Unzip zip files

The unzip command is used to view and decompress zip files. It can list, test and extract ZIP archives. Compressed files in;

Command syntax

unzip [选项] 压缩包名

The commonly used options of this command and their respective meanings are shown in Table 1.

##- d Directory nameExtract the compressed file to the specified directory. -n Existing files will not be overwritten when decompressing. -o Overwrites existing files during decompression without user confirmation. -vView the detailed information of the compressed file, including the file size, file name, compression ratio, etc. contained in the compressed file, but does not perform decompression operations. -t Tests whether the compressed file is damaged, but does not decompress it. -x File ListExtract files, but do not include the files specified in the file list.
Table 1 Common options and meanings of unzip command
OptionsMeaning

Command example

1,

unzip test5.zip Unzip the compressed file test5.zip to the current directory;

What is the command to decompress a zip package in Linux?##2,

unzip -l test5.zip

-l means to view the files in the compressed file without decompression;

What is the command to decompress a zip package in Linux?3,

unzip -v test5.zip

-v means to view the files in the compressed file without decompressing it and display more information (Compression ratio, etc.);

What is the command to decompress a zip package in Linux?4,

unzip -q test.zip

-q means not to display the execution process;

[root@localhost data]# unzip -q test.zip
5,

unzip -o test.zip

-o means not to ask the user and overwrite the original file;

What is the command to decompress a zip package in Linux? 6.

unzip -q -d /data/test/test5 test.zip

unzip -q test.zip -d /data/test/test5)

-d indicates the directory where the specified file will be stored after decompression (-d must be followed by the path, otherwise an error will be reported, and will be automatically created when the path does not exist);

What is the command to decompress a zip package in Linux?Related recommendations: "

Linux video tutorial

The above is the detailed content of What is the command to decompress a zip package in Linux?. 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 [email protected]