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
Preface: This article is based on the experience ...
The experimental environment is as follows Here y...
Table of contents Scene Setting Game Resources Tu...
This article shares with you the installation and...
The sudo command allows a trusted user to run a p...
Table of contents Preface Core - CancelToken Prac...
1 Download MySQL Download address: http://downloa...
The optimization created by MySQL is to add index...
1. Prerequisites JDK has been installed echo $PAT...
When using <a href="" onclick="&...
1. I purchased a VPS and CentOS system, and found...
The Explain command is the first recommended comm...
Install using the MSI installation package Downlo...
1. Background The company's projects have alw...
One environment Alibaba Cloud Server: CentOS 7.4 ...