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

Linux basic command-bunzip2

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

Share

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

Bunzip2

Extract the files compressed by bzip2.

The scope of this command: RedHat, RHEL, Ubuntu, CentOS, SUSE, openSUSE, Fedora.

1. Grammar

Bunzip2 [- fkvsVL] file

2. List of options

Option

Description

-f |-- force

Enforcement

-k |-- keep

Keep the source file after decompression

-v |-- verbose

Show details

-s |-- small

Reduce memory usage for compression, decompression, and testing. The file is decompressed and tested using a modified algorithm, which requires only 2.5 bytes per block byte. This means that any file can be unzipped in 2300 k of memory, albeit at half the normal speed.

-L |-- license |-V |-- version

Displays the software version, license terms and conditions.

3. Examples

1) decompress and retain the compressed package

[root@localhost weijie] # bunzip2-k 2.c.bz2 / / keep the compressed package after decompression

[root@localhost weijie] # ls

11.c 1.c.gz 1.gz 2.c 2.c.bz2 3.c 4.c 5.c 6.c ~ rec000012.c.bz2 res.zip

2) decompression

[root@localhost weijie] # bzip2-d res.bz2 / / decompress

[root@localhost weijie] # ls

11.c 1.c.bz2 2.c 3.c 4.c 5.c 6.c ~ bak res

3) compress two files into one file

[root@localhost weijie] # cat 1.c 2.c / / output the contents of two files

Hello world

I am david.

I love linux

Love code.

one hundred and twenty three

twenty-three

two hundred and twelve

[root@localhost weijie] # bzip2-c 1.c > foo.gz / / compress 1.c to foo

[root@localhost weijie] # bzip2-c 2.c > > foo.gz / / compress 2.c to foo

[root@localhost weijie] # b gzip2-d foo.gz / / extract foo

[root@localhost weijie] # cat foo / / display the contents of foo

Hello world

I am david.

I love linux

Love code.

one hundred and twenty three

twenty-three

two hundred and twelve

A Linux learning platform has been made, and a prototype has come out at present, which you can refer to and use.

Link: https://pan.baidu.com/s/1GOLVU2CbpBNGtunztVpaCQ password: n7bk

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