1. Introduction to compression and packaging Common compressed files windows .rar .zip .7z Linux .zip, .gz, .bz2, .xz, .tar.gz, .tar.bz2, .tar.xz 2. gzip compression tool Eg. gzip and gzip-d examples In the following example, it can be seen that after compression, the actual size of the file changes from 1.6M to 1.3M after decompression, and the number of rows remains unchanged. Gzip -# indicates compression level 1.txt (range 1-9, default 6, increasing from 1 to 9) zacat 1.txt.gz is the command to view the compressed file. The operation process is to decompress it first and then view it. gzip -c 1.txt > /root/1.txt.gz means to decompress 1.txt to root and keep the original file 1.txt bzip2 compression tool Compared with gzip, the compression strength is stronger and the algorithm is different. The stronger the compression strength, the more CPU resources are consumed. The default level specified by bizp is 9. Note the following example, which proves that compressed files can be renamed. If you see a binary file when viewing a txt file, you should use file to view the file first. xz compression tool Not commonly used, but you may see .tar.xz in tarballs. It has stronger compression than bzip. zip compression tool The characteristic of zip is that the original file is not deleted after compression There is no way to view the contents of a zip archive. You can only view the file list instead of the contents through unzip -l tar packaging tool The tar tool is more commonly used on Linux. Tar was originally just a packaging tool, but it also supports 7z, gzip, xz, bzip2 and other tools. These compression tools can only compress files or directories (compress files in a directory separately), but do not realize the packaging and compression of files. Therefore, we do not need to learn several other tools separately. The decompression and compression of tar are the same command, only the parameters are different, which is more convenient to use. Packaging does not significantly change the file size. The purpose is to integrate all types of files into one large file for easy transmission. tar -tf fred.tar View the file list, equivalent to unzip -l Pack and compress, unpack and decompress You may also be interested in:
|
<<: MySQL uses inet_aton and inet_ntoa to process IP address data
>>: Three.js sample code for implementing dewdrop animation effect
Linux uses iftop to monitor the traffic of the ne...
This article uses examples to illustrate the prin...
Introduction: The disadvantages of storing all da...
Table of contents Preface Static scope vs. dynami...
This article shares the specific code of Vue to r...
Download image docker pull mysql:5.7 docker pull ...
Preface Recently I encountered a deadlock problem...
Docker is an open source engine that makes it eas...
Table of contents Preface && Operator || ...
Table of contents 1. Basic Use 2. Working Princip...
Recently I wrote in my blog that in the project l...
Table of contents 1. What is lazy loading? 2. Imp...
The key codes are as follows: Copy code The code i...
Solution 1 Completely uninstall and delete all da...
1. CSS Navigation Bar (1) Function of the navigat...