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".
#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.
Options | Meaning |
Extract the compressed file to the specified directory. | |
Existing files will not be overwritten when decompressing. | |
Overwrites existing files during decompression without user confirmation. | |
View 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. | |
Tests whether the compressed file is damaged, but does not decompress it. | |
Extract files, but do not include the files specified in the file list. |
Command example
1,unzip test5.zip Unzip the compressed file test5.zip to the current directory;
##2,
unzip -l test5.zip
-l means to view the files in the compressed file without decompression;
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.);
4,
unzip -q test.zip-q means not to display the execution process; -o means not to ask the user and overwrite the original file; 6. ( -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); Related recommendations: " 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![root@localhost data]# unzip -q test.zip
unzip -q test.zip -d /data/test/test5
)