Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The realization method of decompression of Bzip2 Command under Linux

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "the implementation of Bzip2 command decompression under Linux". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Gzip, zcat command

[root@linux ~] # gzip [- cdt#] file name

[root@linux ~] # zcat file name .gz

◆ parameters:

-c: output the compressed data to the screen, which can be processed through stream redirection

-d: parameter for decompression

-t: can be used to check the consistency of a compressed file ~ to see if there are any errors in the file

-#: compression level,-1 is the fastest, but the compression ratio is the worst and-9 is the slowest, but the compression ratio is *! The preset is-6 ~

◆ example:

Example 1: copy / etc/man.config to / tmp and compress it with gzip

[root@linux ~] # cd / tmp

[root@linux tmp] # cp / etc/man.config.

[root@linux tmp] # gzip man.config

# at this point, man.config becomes man.config.gz!

Example 2: read out the contents of the file in example one!

[root@linux tmp] # zcat man.config.gz

# the contents of the unzipped man.config.gz file will be displayed on the screen!

Example 3: decompress the file of example 1

[root@linux tmp] # gzip-d man.config.gz

Example 4: compress the man.config extracted from example 3 with a compression ratio of * * and keep the original file

[root@linux tmp] # gzip-9-c man.config > man.config.gz

Linux Bzip2, bzcat command

[root@linux ~] # bzip2 [- cdz] file name

[root@linux ~] # bzcat file name .bz2

◆ parameters:

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

-d: parameter for decompression

-z: compressed parameter

-#: same as gzip, the parameters of compression ratio are calculated.-9 * *,-1 is the fastest!

◆ example:

Example 1: compress the / tmp/man.config in bzip2

[root@linux tmp] # bzip2-z man.config

# at this point, man.config becomes man.config.bz2!

Example 2: read out the contents of the file in example one!

[root@linux tmp] # bzcat man.config.bz2

# the contents of the unzipped man.config.bz2 file will be displayed on the screen!

Example 3: decompress the file of example 1

[root@linux tmp] # bzip2-d man.config.bz2

Example 4: compress the man.config extracted from example 3 with a compression ratio of * * and keep the original file

[root@linux tmp] # bzip2-9-c man.config > man.config.bz2

This is the end of the content of "the implementation of Bzip2 command decompression under Linux". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report