Linux disk and file System Management 5 compression and packaging of Linux files and file systems

Source: Internet
Author: User
Tags bz2 file system gz file

The use and technology of a compressed file

1 At present our computer is measured in byte, but in fact the smallest unit of measurement in the computer is bit. We know 1byte = 8bit

2 Simply put, there will be a lot of "space" in the file, not fully filled, and the compression of the technology is to fill these "space", so that the capacity of these files to take down. Since compressed files cannot be used directly by our operating system, to use these file data, we must decompress

3 at present, many WWW Web sites use compressed technology to carry out data transmission, so that the availability of Web site broadband increase.

Two Linux common compression commands

(1) Compress

1 Compress is very old compression technology, because now gzip can unlock compress compressed files, because this is not explained here

(2) Gzip

1 gzip can be said to be the most widely used compression command, currently gzip can unlock compress,zip and gzip and other software compressed files.

2 gzip New Compressed file name *.gz

3 gzip [-CDTV] filename

-C outputs the compressed data to the screen, which can be processed by data flow redirection

-D Uncompressed Parameters

-T can be used to verify the consistency of a compressed file to see if there are errors in the file

-V can be used to display information such as the compression ratio of the original file/compressed file

4 When we use gzip compression, the default state of the original file will be compressed called. gz file, the original file does not exist.

5 use gzip compressed files, can be winrar in Windows system decompression

6 cat can be used to view plain text files, Zcat can be used to view compressed compressed files

(3) bzip2

The 1 bzip2 is designed to replace Gzip and provide a better compression ratio, bzip2 compression is better than gzip

2 bzip2 [-cdkzv] filename

-c outputs the data produced by the compression process to the screen

-D Uncompressed Parameters

-K retains the original file and does not delete the original file

-Z Parameters for compression

-V can display information such as the compression ratio of the original file/compressed file

3 Use the Compress extension to *. Z, using gzip-enclosed name *.gz, where the bzip2 extension is *.bz2

4 we can use Bzcat to read bzip2 compressed files

(4) Tar

1 tar can package multiple directories or files into a large file, while also supporting GZIP/BZIP2 compression

2 Compression tar-jcv-f filename.tar.bz2

Query Tar-jtv-f filename.tar.bz2

Decompression Tar-jxv-f Filename.tar.bz2-c

3 If the-j parameter is added to represent bzip2 compression, the file is best named *.tar.bz2

If you add the-Z parameter, which represents gzip support, the filename is best for *.tar.gz

4 in the study of tar, the F-filename and other parameters will be independent, it will be less prone to problems

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.