Summary of compression command usage in Linux

Source: Internet
Author: User

Recently learning to use Linux, feel that compression commands are frequently used commands, so it took a little time to summarize the following, in case of normal use later, for the flip.

One of the most used compression commands in "gzip" Linux.
Command using: gzip "-cdtv#" file name
Parameters:
-C: Output compressed data to the screen, or through data flow redirection to handle
-D: Unzip the parameter to delete the original. gz file
-T: Used to verify the consistency of a compressed file to see if the file is error-free
-V: can show the source file/compressed file compression ratio and other information
-#: Compression level, #为1-9 of the number, 9 compression ratio is the highest, but the compression is slow, 1 compression is the smallest, the fastest compression, the default-6 "bzip2" using the method and gzip very similar, compared to GZIP,BZIP2 compression is better.
Command using: bzip2 "-cdktv#" file name
Parameters:
-C: Output compressed data to the screen, or through data flow redirection to handle
-D: Unzip the parameter to delete the original. gz file
-K: Preserves source files and does not delete original files
-T: Used to verify the consistency of a compressed file to see if the file is error-free
-V: can show the source file/compressed file compression ratio and other information
-#: Compression level, #为1-9 number, 9 compression ratio is highest, but compression is slow, 1 compression ratio is minimal, compression is the fastest, default-6

The Tar tar command is very high in Linux, and *.tar.gz or *.tar.bz2 files have to use the tar command.
Parameters:
-C: New package file, often with-V with the file name that is packaged during the viewing process
-C directory: Unzip into the development directory
-F filename:-f followed by the file name being processed
-J: Compression/decompression via bzip2, the file name is preferably *.tar.bz2
-Z: Compression/decompression via GZIP2, the file name is preferably *.tar.gz
-T: View what file names are included in the contents of a packaged file
-V: During compression/decompression, the file being processed is displayed
-X: Unzip
In fact, the most common command of tar is the following 3 forms just remember that the following 3 form is OK:
1. Compression: tar-jcv-f filename.tar.bz2 files or directories to be compressed
2, inquiry: Tar-jtv-f filename.tar.bz2
3, Decompression: Tar-jxv-f filename.tar.bz2-c to extract the directory

Summary of compression command usage in Linux

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.