Linux compression and packaging method 4: compress command

Source: Internet
Author: User

We have met many Linux compression and packaging methods. The following describes the concept of the compress command in the Linux compression and packaging method. I have provided a variety of examples for you to check, I believe there will be a lot of gains after reading this ....

Compress command
[Root @ linux ~] # Compress [-dcr] file or directory

Parameters:
◆-D: extract Parameters
◆-R: the files in the directory can be compressed at the same time!
◆-C: Output compressed data to standardoutput (output to the screen)

Example 1:
Convert/etc/man. config into/tmp and compress it
[Root @ linux ~] # Cd/tmp
[Root @ linuxtmp] # cp/etc/man. config.
[Root @ linuxtmp] # compressman. config
[Root @ linuxtmp] # ls-l
-Rw-r -- 1rootroot2605Jul2711: 43man. config. Z

Example 2:
Unbind the compressed file
[Root @ linuxtmp] # compress-dman.config.Z

Example 3:
Compress man. config into another file for backup
[Root @ linuxtmp] # compress-cman.config> man. config. back. Z
[Root @ linuxtmp] # llman. config *
-Rw-r -- 1rootroot1_6jul2711: 43man. config
-Rw-r -- 1rootroot2605Jul2711: 46man. config. back. Z
This-c parameter is interesting! He will output the data in the compression process to the screen instead of writing it into a file. Z file. Therefore, we can output data to another file name through data stream redirection. We will talk about data stream redirection in details in bashshell!

The preceding section describes the compress commands in the Linux compression and packaging method. The following section describes the tar commands.

  1. Linux compression and packaging method 1)
  2. How to monitor the usage of Linux system resources
  3. A true story about Desktop Linux
  4. Debian edition for the Linux release
  5. Common Linux backup methods

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.