Linux compression and archiving

Source: Internet
Author: User

The compression format in Linux is mainly composed of GZ, bz2, XZ, compress, zip

One, gzip: after compression format is. GZ (after compression and decompression, the original file is deleted)

Usage: gzip [optinons] FILENAME ...

-D: Decompression, equivalent to using Gunzip

-F: Forced decompression

-Q: Do not display warning messages

-#:[0-9] Specify compression ratio

Compression level, 0-2 for fast compression, 3-5 for medium compression, 6-9 for excellent compression, 6 for default

-L: Lists information about compressed files

-R: Recursively handles all files under the specified directory

-T: Test for compressed files with errors

Zcat: In the case of uncompressed, view the contents of the compressed file

Second, bzip2: Compressed after the format of. BZ2, greater compression than gzip, usage and gzip the same

-K: Preserve source files when compressing or decompressing

-D: Decompression, equivalent to using BUNZIP2

-#: Specify compression ratio

Bzcat: In the case of uncompressed, view the contents of the compressed file

Third, XZ: The format is XZ after compression, the new compression tool has a higher compression ratio

-Z: Forced compression

-D: Forced decompression, equivalent to UNXZ

-T: Testing the integrity of compressed files

-L: View more information

-K: Compress or decompress reserved source files

-F: Extract mandatory overwrite file

Xzcat | Xzdec: In the case of uncompressed, view the contents of the file

Four, conpress: After the format is compressed. Z, which is rarely used, is not supported in some Linux distributions

Zip: Zip compression and archive after compression, do not delete source files after compression

Usage: Zip [Optinos] filename.zip FILE1, FILE2 ...

Compression requires a compressed file name Filename.zip

-C: Add comments to a compressed file

-M: Delete source files after compression

-K: DOS compatible

-b<path>: Making compression to the directory

-R: Recursive processing

Zipinfo: View details of files in compressed files

unzip unzip. zip

-O: Do not ask the user, overwrite the source file directly when extracting

-L: Display information for compressed files

-L: Change file name of compressed file to lowercase

-V: The execution is to display more information

-N: Source file not overwritten when uncompressed

. zip file: Specify the files to process

-X File: Specifies a file that is not processed

-Z: equivalent to using Zipinfo to view the details of files within a compressed file

Archive (archive):

Tar: Archive tool, archive does not mean compression, can call compression function implementation

-C: Create an archive file

-F: Archived files for operations

-X: Unzip the archive

--xattrs: Preserves the file's attribute information when archiving

-T: Do not expand the archive to see directly what files are in the archive

-Z: Call the gzip compression command

-J: Call bzip2 compression command

-j: Calling the XZ command

-K: Do not replace existing files when extracting

-V: Show detailed steps

-C: Specify the directory to unzip

-u: Append newer files than archived copies

-U: Delete the file you want to overwrite before extracting it

cpio: archive command used earlier


This article is from the "Pole Men" blog, please be sure to keep this source http://wtime.blog.51cto.com/8829658/1538555

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.