The editor in this article will introduce in detail which command is used to decompress the zip package in linux. The idea of editing is slowly deepening, let's learn new knowledge together.
The command to decompress the zip package in Linux 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 are -d directory name, -n, -o, -v, -t, -x List of files.
Linux unzip command: Unzip zip files
The unzip command is used to view and decompress zip files, you can list, test and extract ZIP Compressed file in archive;
Command Syntax
unzip [options] archivename
The commonly used options of this command and their meanings are shown in Table 1.
Option | Meaning |
-d directory name | Decompress the compressed file to the specified directory. |
-n | Do not overwrite existing files when decompressing. |
-o | Overwrite existing files when decompressing without user confirmation. |
-v | View the detailed information of the compressed file, including the file size, file name and compression ratio contained in the compressed file, but does not Unzip operation. |
-t | Test the compressed file for damage, but do not decompress it. |
-x filelist | Extract files without the files specified in the filelist. |
Command Example
1、unzip test5.zip
decompress File test5.zip to the current directory;
2, unzip -l test5.zip
-l means to view the files in the compressed file without decompression;< /p>
3、unzip -v test5.zip
-v Indicates that in the case of no decompression View the files in the compressed file, and display more information (compression ratio, etc.);
4, unzip -q test.zip
-q means do not display the execution process;
[[email protected] data]# unzip -q test.zip
5, unzip -o test.zip
-o means not asking the user, overwriting the original file;
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 (the path must be followed by -d, otherwise an error will be reported, And when the path does not exist, it will be created automatically);
Copyright Description:No reproduction without permission。
Knowledge sharing community for developers。
Let more developers benefit from it。
Help developers share knowledge through the Internet。
Follow us
2023-03-20
2023-02-06
2023-02-04