Decompress tar. xz in Linux

Source: Internet
Author: User

In Linux, decompress the tar. xz format file and compress the new laptop system a few days ago. You want to re-compile the kernel ...... Dumb's head is that tar-xvjf linux-*** cannot be used to decompress the package. After a close look, we found that the kernel package downloaded on the official kernel website is not bz2 !!! Instead, tar. xz ...... What the fuck! Amount ...... When can I change the format! And ...... What is the special format? Why have I never seen it? You can only try to find out what xz is: [note]: I am using the Ubuntu12.04 system, so the package management command used is aptitude, use the corresponding package management command for other releases! [Cpp] long @ long-Ubuntu :~ $ Aptitude search xz p libxz-java-Java library with a complete implementation of XZ data compression p libxz-java-doc-Documentation for libxz-java p python-txzookeeper-Twisted-based Asynchronous libraries for Apache Zookeeper. v python2.7-txzookeeper-I xz-utils-XZ format compression program p xzdec-XZ-format compression utilities-tiny decompressors p xzgv-Picture viewer for X with a thumbnail-based sel Ector p xzip-Interpreter of Infocom-format story-files p xzoom-magnify part of X display, with real-time updates long @ long-Ubuntu :~ $ Okay, the Chinese system is good! Take a closer look at this line: [cpp] I xz-utils-XZ format compression program directly identified very clearly, XZ compression program, and it seems that my Ubuntu has already been installed (if not, use apt-get to install it )! Find a man (man). Click man xz to see how to perform the operation. The usage of xz is as follows: xz [option]... [file]... the corresponding operations include-z, -- compress Compress. this is the default operation mode when no operation mode option is specified and no other operation mode is implied from the command name (for example, unxz implies -- decompress ). compression, and this is the default operation, that is to say, if there is no operand, adding files in xz is compressed! (Unxz can be used to decompress)-d, -- Decompress, -- uncompress decompress. Decompress. Opposite to-z:-t, -- test the integrity of compressed files. this option is equivalent to -- decompress -- stdout failed t that the decompressed data is discarded instead of being written to standard output. no files are created or removed. test the integrity of the compressed file. This operation will not generate the decompressed file. -L, -- list Print information about compressed files. no uncompressed output is produced, and no files are created or removed. in list mode, the program cannot read the compressed data from standard input or from other unseekable sources. this operation will print the file information and will not generate the decompressed file! Therefore, we can use the following two operations to decompress the compressed file downloaded from the kernel Official Website: 1. use xz to decompress tar. xz file: xz-d linux-3.8.4.tar.xz this operation will be linux-3.8.4.tar. the xz file is decompressed into a linux-3.8.4.tar, And then we unzip the linux-3.8.4.tar. [Note]: the original file is directly used in the compression and decompression processes using xz. For example, after extracting tar. xz, tar is left without the original tar. xz file. You can add-k keys (keepalive to reserve the original file 2.linux-3.8.4.tar decompression: tar-xvf linux-3.8.4.tar operation to complete the final addition of utiutils knowledge: xz utils is lzma utils next generation lzma utils rename utiutils. During compression, the time consumed by utiutils is twice that of bzip2. during compression, the time consumed by xz utils is half that of lzma utils. during compression, the size of files generated by xz utils is half that of bzip2, during compression, the size of the files generated by xz utils is slightly larger than that of lzma utils. during decompression, the time consumed by xz utils is 1/3 of that of bzip2. during decompression, xz utils is slightly faster than lzma utils, during decompression, the time consumed by xz utils is only twice as long as that of gzip. During compression, xz utils is used *. file generation ratio * In xz format *. the lzma format is slightly larger, the test sample is small, and the results of Multiple tests are different. It cannot be determined that xz utils is used *. xz and *. lzma format compression and decompression time who is dominant. So far, the lzma utils compression rate is still the largest, and the utils Decompression Time is dominant. The implementation of a xz file format is available on the Internet. Since version 1.22, GNU tar uses this software to transparently support the xz file format (just as it handles gzip or bzip2 formats ). As a large number of software enters the public domain (such as liblzma), The 4.999.9beta version of the program is released under the terms of gnu lgpl and gnu gpl. 7-Zip supports the xz file format in beta 9.04. That is to say, you can use 7-Zip to decompress the xz compressed file in windows.

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.