Linux package Compression

Source: Internet
Author: User
Tags gz file unpack

Gzip command

Http://blog.csdn.net/sfdev/archive/2009/03/26/4027505.aspx
There are two obvious advantages to reduce the file size. One is to reduce the storage space, and the other is to reduce the transmission time when the file is transmitted over the network.
Gzip is a frequently used command in Linux to compress and decompress files, which is convenient and easy to use.

Syntax: gzip [Option] compressed (decompressed) file name

The options of this command are as follows:
-C: Write the output to the standard output and keep the original file.
-D: Decompress 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, and the name of the uncompressed file.
-R: recursively searches for the specified directory and compresses all the files or decompress them.
-T: test to check whether the compressed file is complete.
-V: displays the file name and compression ratio for each compressed and decompressed file.
-Num: Use the specified numeric num to adjust the compression speed.-1 or -- fast indicates the fastest compression method (low compression ratio ), -9 or -- best indicates the slowest compression method (high compression ratio ). The default value is 6.

Command instance:
Gzip * %: compress each file in the current directory into A. GZ file.
Gzip-DV * %: Decompress each compressed file in the current directory and list detailed information.
Gzip-L * %: detailed information of each compressed file in Example 1, not extracted.
Gzip usr.tar %: Compressed tar backup file usr.tar. the extension name of the compressed file is .tar.gz.

 

The following lists common packaging, compression, and decompression commands in Linux:
. Tar
Unpack: Tar xvf filename.tar
Package: Tar CVF filename.tar dirname
Note: tar is packed, not compressed!
---------------
. GZ
Decompress 1: gunzip filename.gz
Decompress 2: gzip-D filename.gz
Compression: gzip filename
---------------
.Tar.gz and. tgz
Decompress: Tar zxvf filename.tar.gz
Compression: Tar zcvf filename.tar.gz dirname
---------------
. Bz2
Decompress 1: Bzip2-D filename.bz2
Decompress 2: bunzip2 filename.bz2
Compression: Bzip2-Z filename
---------------
.Tar.bz2
Decompress: Tar jxvf filename.tar.bz2
Compression: Tar jcvf filename.tar.bz2 dirname
---------------
. Bz
Extract 1: Bzip2-D filename. bz
Decompress 2: bunzip2 filename. bz
---------------
. Tar. bz
Decompress: Tar jxvf filename.tar. bz
---------------
. Z
Decompress: uncompress filename. Z
Compression: compress filename
---------------
. Tar. Z
Decompress: Tar zxvf filename.tar. Z
Compression: Tar zcvf filename.tar. Z dirname
---------------
. Zip
Decompress: unzip filename.zip
Compression: Zip filename.zip dirname
---------------
. Rar
Decompress: RAR x filename.rar
Compression: rar a filename.rar dirname
---------------
. LHA
Decompress: LHA-e filename. LHA
Compression: LHA-a filename. LHA filename
---------------
. Rpm
Unpack: rpm2cpio filename. RPM | cpio-Div
---------------
. Deb
Unpack: Ar P filename. Deb data.tar.gz | tar zxf-
---------------
. Tar. tgz .tar.gz. tar. z. tar. BZ .tar.bz2. zip. cpio. rpm. deb. SLP. ARJ. RAR. ace. lha. lzh. LZX. LZs. ARC. SDA. SFX. lnx. zoo. cab. kar. CPT. pit. sit. sea
Decompress: Sex x filename .*
Compression: Sex a filename. * filename
Sex only calls related programs and does not support compression or decompression. Please note!

 

This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/sfdev/archive/2009/03/26/4027505.aspx

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.