Home > Article > Operation and Maintenance > What is the linux compression command
Linux compression commands include gzip, bzip and xz. Among them, gzip has the fastest compression speed and is the most widely used compression method. xz is the latest compression method and can automatically provide the best compression rate.
#The operating environment of this article: centos7 system, thinkpad t480 computer.
Linux mainly has three compression methods:
1. Gzip: It is recognized as the fastest compression method. When compressing large files, it is more obvious than other compression methods. It has the longest history. , the most widely used compression method
2. bzip: The file formed by compression is small, but the usability is not as good as gzip
3. xz: It is the latest compression method and can automatically provide the best compression Rate
Recommended suffix when compressing:
Example: Use different compression methods to compress the Golden.apk file in the /root/ directory
First check the size of the Golden.apk file:
You can see that the size of the Golden.apk file is 187M
a. Compress with gzip Method to compress Golden.apk file into Golden.apk.tar.gz file:
b. Use bzip2 compression method to compress Golden.apk file into Golden.apk. tar.bz2 file:
As you can see from the above picture, there is an error in the red box. The reason for this error is the lack of bzip2 package, and you need to install a bzip2 software package
After the installation is complete, re-compress:
During the compression process, we can find:
Compression speed: gz > bz2 > xz
Compression rate: xz > bz2 > gz
The above is the detailed content of What is the linux compression command. For more information, please follow other related articles on the PHP Chinese website!