Usage of different decompression commands for Linux platforms

Source: Internet
Author: User
Tags unpack

Guo Xiaoxing

Weibo: Guo Xiaoxing's Sina Weibo

Email:[email protected]

Blog: http://blog.csdn.net/allenwells

Github:https://github.com/allenwell

I. Tar

Unpack

FileName.tar

Packaged

FileName.tar DirName

Note:tar is packaged, not compressed .

Two. gz

Extract

FileName.gz

Or

-d FileName.gz

Compression

FileName
Three. tar.gz and. tgz

Extract

tar zxvf FileName.tar.gz

Compression

tar zcvf FileName.tar.gz DirName
Four. bz2

Extract

-d FileName.bz2

Or

FileName.bz2

Compression

FileName
Five. tar.bz2

Extract

tar jxvf FileName.tar.bz2

Compression

tar jcvf FileName.tar.bz2 DirName
Six. BZ

Extract

-d FileName.bz

Or

FileName.bz
Seven. tar.bz

Extract

tar jxvf FileName.tar.bz
Eight. Z

Extract

FileName.Z

Compression

FileName
Nine. Tar. Z

Extract

tar Zxvf FileName.tar.Z

Compression

tar Zcvf FileName.tar.Z DirName
10. zip

Extract

FileName.zip

Compression

FileName.zip DirName
11. rar

Extract

FileName.rar

Compression

FileName.rar DirName
12. Lha

Extract

-e FileName.lha

Compression

FileNameFileName
13. rpm

Unpack

FileName
14. Deb

Unpack

FileName.deb

For packages in the following format

. Tar. tgz. tar.gz. Tar. Z. tar.bz. tar.bz2. zip. cpio. Arj. rar. Ace. Lha. Lzh. Lzx. Lzs., Arc. SDA. SFX. Lnx. Zoo. cab. Kar. cpt. P it. Sit. Sea

Extract

FileName.*

Compression

FileNameFileName

Note:sex just calls the relevant program, itself does not have compression, decompression function .

So many tools, if we are compressed files, which tool to use, the following is a very useful in the Linux platform for a decompression tool.

gzip command

There are two obvious benefits of reducing file size, one is to reduce storage space, and the other is to reduce transmission time when transferring files over the network. Gzip is a frequently used Linux system command to compress and decompress files, which is both convenient and useful.

语法:gzip[选项] 压缩(解压缩)的文件名

The options for this command have the following meanings:

    • -C writes the output to the standard output and retains the original file.

    • -D Unzip the compressed file.

    • -L Displays the following fields for each compressed file: The size of the compressed file, the size of the uncompressed file, the compression ratio, the name of the uncompressed file

    • -R recursively finds the specified directory and compresses all of its files or is decompressed.

    • -T test to check that the compressed file is complete.

    • -V for each compression and decompression file, display the filename and compression ratio.

    • -num adjusts the speed of compression with the specified number num,

    • -1 or –fast represents the fastest compression method (low compression ratio),

    • -9 or –best represents the slowest compression method (high compression ratio). The system default value is 6.

Example

.gz 文件。gzip -dv *% 把当前目录下每个压缩的文件解压,并列出详细的信息。gzip -l *% 详细显示例1中每个压缩的文件的信息,并不解压。gzip usr.tar% 压缩 tar 备份文件 usr.tar,此时压缩文件的扩展名为.tar.gz。

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

How to use different decompression commands for Linux platforms

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.