How to package, compress, and unzip the tar to a specified directory

Source: Internet
Author: User

Tar is commonly used on Linux packaging, compression, compression tools, he has a lot of parameters, folding only to enumerate the commonly used compression and decompression parameters

Parameters:

-c:create set up the parameters of compressed archives;

-X: Extracting parameters of compressed archives;

-Z: Whether to use gzip compression;

-V: Files are displayed during compression;

-F: The top document name, immediately after F to answer the file name, can not add parameters

Example: First, the entire/home/www/images directory of files are packaged as/home/www/images.tar

[[email protected] ~]# tar-cvf/home/www/images.tar/home/www/images← package only, do not compress

[[email protected] ~]# tar-zcvf/home/www/images.tar.gz/home/www/images← after packing, compress with gzip

The compressed file name after the parameter F is self-fetching, used in tar to do, if the z parameter, then tar.gz or tgz to represent the gzip compressed tar file file

Example: Two, extract/home/www/images.tar.gz to/home/www below

[Email protected] ~]# cd/home/www

[Email protected] ~]# tar-zxvf/home/images.tar.gz

Unzip to the specified directory

[Email protected] ~]# tar-zxvf/home/images.tar.gz-c/specific dir

Unpacking to the specified directory

Tar xvf filename.tar-c/specific dir

How to package, compress, and unzip the tar to a specified directory

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.