Detailed explanation of tar extract XZ file in Linux

Source: Internet
Author: User
Tags tar extract phpmyadmin

XZ This compression may be a lot of unfamiliar, but you can see that XZ is the absolute number of Linux default to take a compression tool.
Before the XZ use has been very little, so hardly anything to mention.


I was downloading phpmyadmin when I saw this compression format, phpMyAdmin compression package XZ format incredibly smaller than 7z, which aroused my interest.
The latest period of time will often hear the XZ adopted sound, such as the latest archlinux something on the use of XZ compression. But the XZ also has a disadvantage is that the compression time is longer, than the 7z compression time is longer. However, compression is one-off, so you can ignore it.
XZ compressed file method or command


xz-z files to compress


If you want to keep the compressed file plus parameter-K, if you want to set the compression rate add parameter-0 to-9 to adjust the compression rate. If not set, the default compression level is 6.
XZ unzip the file method or command


Xz-d the files to extract


Also use the-K argument to retain the uncompressed file.


Ways to create or extract TAR.XZ files


People accustomed to tar czvf or tar xzvf may encounter tar.xz also want to use a single command to fix decompression or compression. Not really. The parameters of the XZ format, such as Z, for Gzip,j are directed at bzip2.
To create a tar.xz file: Just tar cvf xxx.tar xxx/create xxx.tar files First, then use Xz-z Xxx.tar to compress Xxx.tar into XXX.TAR.XZ
Extract tar.xz files: First xz-d xxx.tar.xz xxx.tar.xz extract into Xxx.tar then, then use the tar xvf Xxx.tar to unpack.

Tar command

Extract


Syntax: tar [main options + auxiliary options] File or directory

When using this command, the main option is required, it tells Tar what to do, the auxiliary option is auxiliary, and can be selected.

Main options:

C Create a new profile. If the user wants to back up a directory or some files, select this option. Equivalent to packing.

X releases the file from the profile. Equivalent to unpacking.

T lists the contents of the profile to see which files have been backed up.

In particular, in the release of the parameters, c/x/t can only exist one! Not exist at the same time! Because it is not possible to compress and decompress at the same time.

Accessibility Options:

-Z: Do you have gzip properties at the same time? Is it necessary to use gzip compression or decompression? The general format is xx.tar.gz or XX. tgz

-j: Do you have bzip2 properties at the same time? Is it necessary to compress or decompress with bzip2? General format for XX.TAR.BZ2

-V: Display files during compression! This common

-F: Use file name, please note that after F to immediately receive file name Oh! Don't add any more parameters!

-P: Use the original properties of the original file (properties will not be changed according to the user)

--exclude file: Do not package file in the process of compression!

Related Article

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.