Linux compression and packaging method 2: gzip and zcat commands

Source: Internet
Author: User

There are many Linux compression and packaging methods. The following describes the concepts of gzip and zcat commands, and lists examples of various Linux compression and packaging methods for your reference, hope to help you ....

Gzip and zcat commands
[Root @ linux ~] # Gzip [-cdt #] File Name
[Root @ linux ~] # Zcat file name .gz

Parameters:
◆-C: Output compressed data to the screen, which can be processed through data stream redirection;
◆-D: extract parameters;
◆-T: it can be used to check the consistency of a compressed file ~ Check whether the file has any errors;
◆-#: Compression level.-1 is the fastest, but the compression ratio is the worst.-9 is the slowest, but the compression ratio is the best! Default Value:-6 ~

Example 1:
Convert/etc/man. config into/tmp and compress it with gzip
[Root @ linux ~] # Cd/tmp
[Root @ linux tmp] # cp/etc/man. config.
[Root @ linux tmp] # gzip man. config
At this time, man. config will become man.config.gz!

Example 2:
Read the file content in Example 1!
[Root @ linux tmp] # zcat man.config.gz
# The man.config.gz extracted file content is displayed on the screen !!

Example 3:
Decompress the file in Example 1
[Root @ linux tmp] # gzip-d man.config.gz

Example 4: compress man. config unlocked in Example 3 with the optimal compression ratio and keep the original file
[Root @ linux tmp] # gzip-9-c man. config> man.config.gz

The above is the gzip and zcat commands in the Linux compression and packaging method. The following describes the bzip2 and bzcat commands.

  1. Linux compression and packaging method 1)
  2. How to monitor the usage of Linux system resources
  3. Do you know Linux file extensions?
  4. Debian edition for the Linux release
  5. Multiple Linux compression methods

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.