Detailed parsing of compression commands in Linux (II.)

Source: Internet
Author: User

We have explained the common three kinds of compression commands in the detailed parsing of compression commands in Linux (i), and we begin to explain the tar commands most commonly used in our work.

To make compression and decompression easier, the tar command came into being. So how exactly should we use it?


tar.gz format:

Compression command:

TAR-ZCVF compressed file name source file name

Example:

Compress the ABC file into a file with the suffix tar.gz format

TAR-ZCVF abc.tar.gz ABC


Decompression command:

Example: Unzip the abc.tar.gz file

TAR-ZXVF abc.tar.gz



TAR.BZ2 format:

Compression command:

Example: compressing an ABC file into a file with the suffix tar.bz2 format

TAR-JCVF abc.tar.bz2 ABC


Decompression command:

Example:

Unzip the abc.tar.bz2 file.

TAR-JXVF abc.tar.bz2



In particular:

① to compress the ABC file into the specified directory:

TAR-ZCVF/HOME/ABC.TAR.GZ ABC

Or

TAR-JCVF/HOME/ABC.TAR.GZ ABC


② extract the abc.tar.gz and abc.tar.bz2 into the/home directory:

TAR-ZXVF Abc.tar.gz-c/Home

Or

TAR-JXVF Abc.tar.bz2-c/Home

This article is from "Juzhou Youth" blog, please be sure to keep this source http://zhengkangkang.blog.51cto.com/12015643/1855030

Detailed parsing of compression commands in Linux (II.)

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.