Linux Learning Notes

Source: Internet
Author: User


1. Linux disk and file system Management --not learned



2. common compression commands for Linux systems

2.1 Common Compressed file extensions *.tar, *.tar.gz, *.tgz, *.gz, *. Z, *.bz2

*. Z Compress program compressed files, obsolete;

*.gz gzip program compressed files;

*.BZ2 bzip2 program compressed files;

*.tar the TAR program to package the data, and has not been compressed;

*.tar.gz tar program packaged files, which are also compressed by gzip

*.TAR.BZ2 tar program packaged files, which are bzip2 compressed

2.2 gzip [-cdtv#] File

-C: Output compressed data to the screen, can be processed through data flow redirection;

-D: the extracted parameters;

-T: can be used to verify the consistency of a compressed file ~ See if there are errors;

-V: can display the original file/compressed file compression ratio and other information;

-#: Compression level, 1 the fastest, but the worst compression, 9 slowest, but the best compression! Default is-6

Example: Gzip-v pafa.log compression

gzip-d pafa.log.gz Decompression

Gzip-c pafa.log > pafa.log.gz Compress and keep the original file


Zcat file. gz

Example: Zcat pafa.log.gz Read Compressed file contents


bzip2 [-cdkzv#] File

-C: Output the data generated by the compression process to the screen!

-D: decompressed parameters

-K: retains the original file without deleting the original file Oh!

-Z: Compressed parameters

-V: can display the original file/compressed file compression ratio and other information;

-#: Same as gzip, all in the calculation of compression ratio parameters,-9 best,-1 fastest! 6, yes.

Example: Bzip2-z pafa.log compression

bzip2-d pafa.log.bz2 Decompression


Linux Learning Notes

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.