Home > Operation and Maintenance > Linux Operation and Maintenance > What is the difference between Linux packaging and compression

What is the difference between Linux packaging and compression

青灯夜游
Release: 2023-02-08 17:59:51
Original
2453 people have browsed it

Difference: 1. Packaging refers to storing multiple files and directories in one file, while compression refers to using algorithms to process files to reduce the disk space occupied. 2. There are two commonly used packaging commands, namely tar and dd; there are many commonly used compression commands, such as gzip, zip, bzip2, etc.

What is the difference between Linux packaging and compression

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

Packaging

Packaging, also called archive, refers to a collection of files or directories, and this collection is stored in a file. The archive is not compressed, so the space it takes up is the sum of all files and directories in it. Usually, archiving is always associated with system (data) backup.

Compression

Compression refers to the use of algorithms to process files to achieve the purpose of retaining the maximum file information and reducing the file size. The basic principle is to create a dictionary file of the same bytes by searching for repeated bytes in the file, and represent it with a code.

Compression is similar to archive files. Compressed files are also a collection of files and directories, and this collection is also stored in a file. But their difference is that compressed files use different storage methods. Make it take up less disk space than the combined size of all files in the collection.

Since the information processed by the computer is expressed in binary form, the compression software marks the same string of characters in the binary information with special characters. As long as through reasonable mathematical calculations, the file volume can be reduced Greatly compressed. Use compression software to compress one or more files to form a file compression package, which can save storage space and facilitate transmission on the network.

Compressing a file is likely to damage the content in the file. Therefore, compression can be divided into lossy compression and lossless compression. Lossless compression is easy to understand, which means that the compressed data must be accurate; lossy compression means that even if individual data is lost, it will not have much impact on the file. Lossy compression is widely used in animation, sound and image files. Typical representatives are the video file format mpeg, the music file format mp3 and the image file format jpg.

Use a compression tool to compress the file, and the generated file is called a compressed package. The size of the file is usually only half of the original file or even smaller. It should be noted that the data in the compressed package cannot be used directly. You need to use a compression tool to restore the file data before use. This process is also called decompression.

The difference between packaging and compression

Packaging refers to storing multiple files and directories in one file, while compression refers to using algorithms to compress files Processed to reduce the disk space occupied.

Under Linux, there are two commonly used packaging commands, namely tar and dd; there are many commonly used compression commands, such as gzip, zip, bzip2, etc.

Related recommendations: "Linux Video Tutorial"

The above is the detailed content of What is the difference between Linux packaging and compression. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template