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
Table of contents Boolean Type Number Types Strin...
Table of contents 1. Data Type 1.1 Why do we need...
-9999 px image replacement technology has been pop...
1. Environmental Preparation 1.MySQL installation...
Preface I believe that everyone has had experienc...
Priority The reason why placing the same conditio...
Configure Mysql master-slave service implementati...
This article shares the tutorial of MySql install...
I will not introduce what CUDA is, but will direc...
1. Autoflow attribute, if the length and width of...
Table of contents 1. Leftmost prefix principle 2....
The table structure is as follows: id varchar(32)...
Build the image There are two main ways to build ...
Table of contents origin status quo Cancel reques...
1. Overview This article systematically explains ...