Open In App

bzmore command in Linux with examples

bzmore command in Linux is used as a filter for CRT viewing of bzip2 compressed files, which are saved with .bz2 suffix. In simple words, using ‘bzmore’, the content of the file can be viewed on the screen without uncompressing the file. bzip2 is a block-sorting file compressor which compresses files using the Burrows-Wheeler block sorting text compression algorithm, and Huffman coding. bzip2 compresses files more effectively than the older Deflate (.zip and .gz) and LZW (.Z) compression algorithms, but is slower. While the bzip2 command line utility can be used to compress files, there are many other tools that let you perform basic tasks – like searching, comparing, and more without the need to uncompress them. bzmore is just like ‘more‘ command in Linux but it is mainly used for compressed bz2 files. bzmore allows examination of compressed files one screenful at a time on the terminal and pauses, with the bottom line printing “–More–” on the screen. For performing further tasks on the terminal, various options are available. Syntax :

bzmore [ name ...]

Example: A text file named GFG.txt is compressed via bzip2. After the compression, the file is saved as GFG.txt.bz2. In this file, for instance contains numbers ranging from 1 to 40 like this:



1
2
3
.
.
.
40

Now, To view the contents of this file execute the following command:

bzmore filename.bz2

This command prints a screenful of text on the terminal. Options: These options are executed on the ‘–More–‘ statement present in the end of the terminal.



d
4(space)
5z
2s
1f
2f
q
=
.
$ bzmore --help
$ bzmore --version
Article Tags :