Home >Operation and Maintenance >Linux Operation and Maintenance >What is the linux compression command

What is the linux compression command

王林
王林Original
2021-04-14 14:58:1434349browse

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.

What is the linux compression command

#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:

What is the linux compression command

Example: Use different compression methods to compress the Golden.apk file in the /root/ directory

First check the size of the Golden.apk file:

What is the linux compression command

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:

What is the linux compression command

b. Use bzip2 compression method to compress Golden.apk file into Golden.apk. tar.bz2 file:

What is the linux compression command

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

What is the linux compression command

After the installation is complete, re-compress:

What is the linux compression command

During the compression process, we can find:

Compression speed: gz > bz2 > xz
Compression rate: xz > bz2 > gz

What is the linux compression command

##Free learning video sharing:

linux video Tutorial

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn