Tar extract to specified directory

Source: Internet
Author: User
Tags tar extract

Parameters:

-c:create to establish the parameters of compressed files;

-X: Unzip the parameters of the compressed file;

-Z: Do you want to use gzip compression;

-V: The process of compressing the display of files;

-F: Top document name, immediately followed by the file name, can not add parameters


For example: One, all the files in the entire/home/www/images directory are packaged as/home/www/images.tar

[root@xoaocom ~]# tar-cvf/home/www/images.tar/home/www/images← package only, not compressed

[root@xoaocom ~]# tar-zcvf/home/www/images.tar.gz/home/www/images← after packaging, gzip compressed


The compressed filename after the parameter f is taken by itself, used in tar, and, if the z parameter is added, to tar.gz or tgz to represent the gzip-compressed tar file file


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

[Root@xoaocom ~]# Cd/home/www

[Root@xoaocom ~]# tar-zxvf/home/images.tar.gz


Extract to the specified directory

[root@xoaocom ~]# tar-zxvf/home/images.tar.gz-c/specific dir


Unpack to the specified directory

Tar xvf filename.tar-c/specific dir

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.