The tar of Advanced Linux commands

Source: Internet
Author: User

Tar common options

-C (Create) represents the creation of a package used to generate a file

-X: Extract, extract file from package

-T to view compressed files.

-Z is processed using gzip, which is combined with "C" to represent compression, which is combined with "X" to represent decompression.

-j is processed using BZIP2 mode, which is combined with "C" to represent compression, and "X" is used to represent the decompression.

-V (verbose) detailed report on tar processing information

-F (file) represents the document followed by a filename.

-c < Specify directory > extract to specified directory

1.tar Packaging, gzip compression

1) compression

TAR-CZVF compressed file name Directory name

such as: Tar czvf dira.tar.gz dira

Attention:

TAR-CZVF and tar czvf are the same effect, so say, after the unification is canceled-.

2) View

Tar TVF Compressed file name

such as: Tar TVF dira.tar.gz

3) Unzip

Tar xzvf Compressed file name

Tar xzvf compressed file name-C specified directory

such as: Tar XZVF dira.tar.gz extract to the current directory

such as: Tar xzvf dira.tar.gz-c/home/book extract to/home/book

2.tar Packaging, bzip2 compression

1) compression

Tar cjvf compressed file name Directory name

such as: Tar cjvf dira.tar.bz2 dira

2) View

Tar TVF Compressed file name

such as: Tar TVF dira.tar.bz2

3) Unzip

Tar xjvf Compressed file name

Tar xjvf compressed file name-C specified directory

such as: Tar XJVF dira.tar.bz2 extract to the current directory

such as: Tar xjvf dira.tar.bz2-c/home/book extract to/home/book


This article from "Van Gogh said my brain is sick" blog, declined reprint!

The tar of Advanced Linux commands

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.