[Ruimo Network] Detailed explanation of zip compression and decompression commands commonly used in Linux

Common commands

  I believe that for many friends who have a certain Linux foundation , the commonly used compression commands include: zip, unzip, tar, gzip, bzip2 and other commonly used commands. The following is a detailed explanation of the usage methods and parameters of zip and unzip.

zip compression example

Compress files or folders in the Linux system, so that the compressed file suffix is ​​zip.

 As shown in the figure above, there are two files under the test folder: admin folder, index and test, which are now packaged into a compressed admin.zip file, and the executed command is:

 zip -p -r admin.zip admin/
复制代码

By executing the command, you can see that the three files and folders under the test folder have been packaged and turned into admin.zip compressed files. The details are as follows:

unzip decompression example

The files under the test folder have been compressed through the example above, so now decompress the compressed file admin.zip, first delete other files, and only keep the admin.zip file.

After executing the following decompression command, you can see that the admin.zip file has decompressed the file we just compressed.

unzip admin.zip 
复制代码

zipinfo example

One of zip and unzip is a compression command, and the other is a decompression command, so how to check what content is contained in a compressed file without decompressing the file? The zipinfo command is used below. The zipinfo command is used to list the compressed file information, and you can know the detailed information of the compressed file without decompressing it. For example, execute the command as follows:

zipinfo admin.zip 
复制代码

 After executing the command. We can see the basic information of the compressed file, including the size of the compressed file, the number of files, the permission information of the file, the date information of the file, the specific file name and folder information, which is still very comprehensive. The specific screenshot information is as follows:

epilogue

Well, the above is the detailed explanation of the zip compression and decompression commands commonly used in Linux. Thank you for reading, I hope you like it, if it is helpful to you, please like and bookmark. If there are deficiencies, welcome to comment and correct. See you next time.

Guess you like

Origin blog.csdn.net/rrmod/article/details/129030652