Wednesday, December 5, 2007

HowTo: View Bzipped file On-The-Fly

A quick blog entry post.

Here's how to view text files compressed by linux command bzip2. If you wish to know more command usage of bzip2 binary, click here.

Viewing of bzipped compressed files can be done in many ways. This blog entry would cover doing this approach by using bzcat, bzmore and bzless linux binaries. Bzcat, bzmore and bzless binaries are part of bzip2 rpm package.

Bzcat command functions to view bzipped compressed text file and show them to stdout. Bzmore and bzless acts similarly the same but shows viewing of bzipped files screen updates and pauses at a time.. Bzless clears the screen first and views bzipped file one screen at a time or one bzipped file at a time which is the reverse of bzmore. Both Bzmore and bzless commands process and view compressed text files interactively. Interactive keyboard commands are much more similar to more and less linux binaries.

BzCat, BzMore, and BzLess Command Usage

Supposed that you have a large compressed (bzipped) text file and you wish to view it on the fly from your current session terminal without actually bunzipping them, these bz viewer binaries could come quite handy. Standard linux output can also be passed as a standard parameter with these bz viewers. Avoid using these bz viewers from bzipped binary files.

How to view BZipped compressed files?

Viewing bzipped files requires file input parameter. These parameter can be in a file blog format like shown below.

Sample bzcat, bzmore, bzless usage

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# bzmore testfile.txt.bz2
# bzmore *.bz2
# bzless testfile.txt.bz2
# bzless *.bz2
# bzcat testfile.txt.bz2
# bzcat *.bz2
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

HTH

0 comments:

Sign up for PayPal and start accepting credit card payments instantly.
ILoveTux - howtos and news | About | Contact | TOS | Policy