Linux compression, decompression, archiving detailed

Source: Internet
Author: User
Tags bz2 gz file

Common compression tools under Linux are zip, bzip2, gzip, XZ, tar

Decompression tools are unzip, BUNZIP2, Gunzip, Unxz

bzip2, gzip, three commands above can not compress the directory, only the files under the directory compression

Compression command:

Zip command: is an application-wide cross-platform compression tool that compresses file suffixes to zip files

Grammar:

zip[parameters] [file]

List parameters:

-A automatically unzip the file

-C Add Comment to compressed file

-D Delete File

-F Repairing corrupted files

-K compatible DOS

-M after the compression is complete, delete the garden file

-Q Runtime does not display information processing

-R handles the use of subdirectories under the specified directory and the specified directory

-V Displays information processing information

-Y reserved Symbolic link

As an example:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/49/11/wKiom1QObHKyw20NAAFnju2PAdM696.jpg "title=" image 033. JPG "alt=" wkiom1qobhkyw20naafnju2padm696.jpg "/>


bzip2 command: BZIP2 uses the new compression algorithm, the compression effect is better than the traditional lz77/lz78 compression algorithm. If you do not add any parameters, bzip2 compresses the file after compressing it with the suffix bz2 file, and deletes the original file.

Grammar:

bzip2[parameters] [file]

List parameters:

-c|--stdout compression or compression results output to standard output

-d|--decompress performs the decompression.

-f|--force forced decompression, overwriting files of the same name

-k|--keep bzip2 The original file is not deleted after compression or decompression.

-s|--small reduces the amount of memory used when the program executes.

-t|--test Check the integrity of the. bz2 compressed file. But no pressure.

The-v|--verbose displays detailed information.

-z|--compress forces the compression to execute.

-l|--license displaying software version information

-#: Specify compression ratio

-1| set the block size to 100kb when compressing

-9| set the block size to 900kb when compressing

-Q does not display a warning message

As an example:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/49/13/wKioL1QOb0iRqu8HAAGBvx-IF0A258.jpg "title=" image 034. JPG "alt=" wkiol1qob0irqu8haagbvx-if0a258.jpg "/>


Gzip command: Is the use of a wide range of compression programs, the zip file extension is GZ

Grammar:

gzip[parameters][file or directory]

List parameters:

-a|--ascii ASCII mode

-c|--stdout|--to-stdout retains the original file and outputs the compressed anthology to the standard output

-d|--decompress|----Uncompress Unpack the compressed file

-f|--force Forcing compressed files

-l|--list Information List of compressed files

-n|--no-name the original file name and timestamp is not saved when compressing the file

-n|--name Save the original file name and time stamp when compressing the file

-q|--quiet does not display a warning message

-r|--recursive processing all files and subdirectories in the specified directory at the same time

-t|--test test if the compressed file is correct

-v|--verbose Show Detailed process

-< compression Efficiency > 1-9 value, default is 6, the higher the value, the higher the compression rate

As an example:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/49/12/wKiom1QOckWC5FoyAAFZrRnKMTE882.jpg "title=" image 035. JPG "alt=" wkiom1qockwc5foyaafzrrnkmte882.jpg "/>


XZ command: Is a lossless data compression file format using the LZMA compression algorithm, and the suffix of the compressed file is the XZ file

Grammar:

xz[parameters [file or directory]

List parameters:

-t|--test testing the integrity of compressed files

-l|--list list information for related files

-f|--force forced decompression, overwriting files of the same name

-k|--keep Keep the original file

-q|--quiet does not display a warning message

-v|--verbose Show Detailed process

As an example:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/49/12/wKiom1QOdwrgrQrJAAC9VsjkdVs473.jpg "title=" image 036. JPG "alt=" wkiom1qodwrgrqrjaac9vsjkdvs473.jpg "/>


Tar command: Archive, used to compress and decompress files, tar itself does not have compression function, it is called the compression function implemented

Grammar:

tar[parameters] [ file]

List parameters:

-A add compressed file to existing compression

-B Set Chunk size

-C Create a new compressed file

-D Record File differences

- f filename : Specify file name after archive

-R Add a file to a file that has been compressed

-u add changed and existing files to a compressed file that already exists

-X extracting files from compressed files

-T displays the contents of the compressed file

-Z: Call gzip

-j: Call bzip2

-j: Call XZ

- C: Specify the expansion Location

-Z Support Compress unzip files

-V Show Operation procedure

-L File System boundary settings

-K Keep the original file without overwriting

-m reserved files are not overwritten

-W confirm the correctness of the compressed file

As an example:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/49/13/wKiom1QOlUSSE7gIAAFwrwTeBL0829.jpg "title=" image 037. JPG "alt=" wkiom1qolusse7giaafwrwtebl0829.jpg "/>


Decompression command:

Unzip command: Used to extract the suffix named zip file

Grammar:

unzip[parameters] [file]

List parameters:

- C output compression results to standard output

-F Update File

-L Show files in compressed package

-T Checksum

-V displays detailed processing information

-Z Display Note information

-Q does not display processing information

As an example:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/49/14/wKiom1QOmq2Amq26AAF9jXkW_CI115.jpg "title=" image 038. JPG "alt=" wkiom1qomq2amq26aaf9jxkw_ci115.jpg "/>


BUNZIP2 command: Equivalent to bzip2-d is bzip2 symbolic link, extract the suffix named bz2 file

Grammar:

Parameters File

List parameters:

-F Force decompression, overwriting the current file with the same name

-K retain the original file after decompression, not reserved by default

-S reduces memory consumed by program execution

-V run-time display believing processing information

-c The output of the extracted data directly to the standard output

As an example:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/49/16/wKioL1QOnPDRQ--lAAERF-WVJCI574.jpg "title=" image 039. JPG "alt=" wkiol1qonpdrq--laaerf-wvjci574.jpg "/>


Gunzip command: Used to extract files, is done by gzip command, is the hard link of gzip. Unzip the suffix named GZ file

Grammar:

Parameters File

List parameters:

-a|--ascii ASCII mode.

-c|--stdout|--to-stdout result output to standard output

-f|-force Force decompression, overwrite the current file with the same name

-l|--list lists the compressed file information.

-q|--quiet does not display a warning message.

-t|--test test that the compressed file is correct.

-v|--verbose Show Detailed process

-r|--recursive all files at the same time as the sub-directory when extracting

As an example:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/49/16/wKioL1QOnvuSzfkKAAEZonrCvjc385.jpg "title=" image 040. JPG "alt=" wkiol1qonvuszfkkaaezonrcvjc385.jpg "/>


UNXZ command: Equivalent to xz-d is a hard link to xz, extract the suffix named XZ file

Grammar:

Parameters File

List parameters:

-t|--test Testing the integrity of compressed files

-k|--keep Keep the original file

-f|--force Force decompression, overwrite the current file with the same name

-c|--stdout|--to-stdout result output to standard output

-0..-9 compression ratio; 0-2 fast compression, 3-5 good 6-9 excellent compression; The default value is 6

-q|--quiet suppress warning; Specify too many two-time compression errors

-h|--help help show this short help

-h|--long-Help (also listed with advanced options) show long-term help

-v|--version Display version number

As an example:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/49/17/wKioL1QOpQbBJszXAAFmF0Oc2LM460.jpg "title=" image 041. JPG "alt=" wkiol1qopqbbjszxaafmf0oc2lm460.jpg "/>


The tools for viewing the contents of compressed files under Linux are:

Zcat viewing the contents of a file with a suffix named GZ

Bzcat viewing the contents of a file with the suffix named bz2

Xzcat viewing the contents of a file with a suffix named XZ

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/49/16/wKiom1QOrgiRzOYrAAB9P7NjfBc771.jpg "title=" image 042. JPG "alt=" wkiom1qorgirzoyraab9p7njfbc771.jpg "/>


life is endless, learn more!

This article is from "Why No!" blog, be sure to keep this source http://dovemy.blog.51cto.com/8487472/1550248

Linux compression, decompression, archiving detailed

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.