Summary of compression and decompression commands in Linux

Source: Internet
Author: User
Tags bz2 gz file

In Linux, compression and decompression operations are very common, and its command parameters are also very much, here only the most commonly used with packaged files of several compression and decompression methods and several of the most commonly used parameters.

Now the most commonly used compression and decompression tools are gzip and bzip2, both of which cannot decompress each other's compressed files. There is no suffix in Linux, but it is convenient for users to extract files, so they often use different suffix names to distinguish the tool used when compressing. The file suffix name that is generally used for gzip compression is. GZ, which is named. bz2 with bzip2 compressed files, and packaged files typically use the Tar tool, so the file suffix that is compressed and then packaged is typically. tar.gz or. tar.bz2. (There are, of course, several other forms, which only discuss these two, which will be supplemented by one later. Tar.xz)

All right, let's talk about the compression and decompression commands and main parameters, in fact, compression and decompression are all with the tar command, just configure different parameters only.

Tar-[parameter] original file name

Main parameters:

C: Compression

X: Unzip

T: View

(c,x,t three parameters and only one)

J: It is compressed or decompressed with the bzip2 file (this parameter must be used when extracting the tar.bz2 file)

Z: It is compressed or decompressed with gzip file (this parameter must be used when extracting the tar.gz file)

V: Observe the process of compression and decompression

F: followed by the source file name, often alone with a-F, such as Tar-xjv-f Fliename

C: You can configure this parameter when extracting, if the configuration then give a directory, the extracted files will be in this directory such as Tar-xjv-f fliename1 c/home/filename2

Well, the two commonly used tools to write here, the following write a use is also more than the. tar.xz file decompression, the file's decompression tools generally do not have a Linux system, you need to download the configuration, here to steal a lazy, refer to other people's solution, pro-test available.

Reference article URL: http://blog.sina.com.cn/s/blog_906683280102v0mi.html

1. Download XZ pack http://tukaani.org/xz/xz-4.999.9beta.tar.bz22. Unzip the installation package $TAR-JXVF xz-4.999.9beta.tar.bz23. Configuration & Installation $./ Configure--prefix=/opt/gnu/xz$make$sudo make Install$ln-s/opt/gnu/xz/bin/xz/bin/xz decompression method: 1. Decompression XZ Package $xz-d * * *. TAR.XZ2. Unpacking the tar package $TAR-XVF ***.tar

Summary of compression and decompression commands in Linux

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.