Get the App
SLTechnology News&Howtos  ›  Servers  › 

Linux basic command-bunzip2

Shulou Source: shulou.com Published: 2022-06-02 05:56:31 09月12日 Update

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

Tags: File two memory content bytes algorithm speed test command information instance password platform meaning condition clause source file version scope syntax Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Shulou Technology OPPO Reno vpn Microsoft