Use of the Tar tool under Linux

Source: Internet
Author: User

use of the tar tool

Packaging:


    1. Description: after mastering the tar Tools on Linux, you can take care of most of the compressed files on Linux, although Tar is just a packaging tool, but it also supports compression tools such as 7Z,GZIP,XZ,BZIP2. This shoe compression tool itself can only compress files or directories, and does not implement package compression for files. and the tar decompression and compression is the same command, but the parameters are different, but also convenient memory.
    2. Vim Li///Create a file, write something in it
    3. TAR-CF Li.tar li///to package Li,-c to create a tar package;-F to specify the name of the file to be created, the file name must be immediately behind F
    4. Du-h li.tar/du-h li///can find two file sizes almost identical, because there is no compression now just packaging
    5. mkdir pizi,tar-xf li.tar-c pizi///-x means unpacking;-C means specifying to the development directory
    6. TAR-CPHF Li.tar li///-p means to use tar packaging to preserve the properties of a file while another host is restored;-H indicates that the backup link points to the source file instead of the link itself.
Compression:


    1. Summary: To create a file of different compressed format, for the tar is to change a parameter, then the gzip created *.tar.gz file as an example to illustrate.
    2. TAR-CZF li.tar.gz li///simply add a Z parameter on the package basis to compress the file using gzip
    3. Tar-xzf li.tar.gz///Extract Files
    4. Appendix Other compression tools parameters for compressing or extracting files
        Compress file format parameters

*.tar.gz - z

*.tar.xz-j

*.tar.bz2-j

                                                            

@ Leather likes to play basketball         

Use of the Tar tool under Linux

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.