lbzip2 logo


Extra lbzip2 utilities

lbzip2 utilities (or lbzip2-utils) is a set of simple utility tools for working with compressed bz2 files.

lbzip2 utilities are not included in lbzip2 itself, but they come as an extra package with its own release cycle, versioning and so on. There are no plans for including them in lbzip2 itself.

lbzmerge – merge compressed files

bz2 files can be merged by just concatenating them. However some tools and libraries may not be able to process such files properly. lbzmerge utility can be used to merge bz2 without recompressing them in such way that all tools should be able to handle the resulting bz2 file.

lbzmerge reads bz2 file from standard input and rewrites it to standard output. The resulting file contains only one bz2 stream, even if input file consisted of multiple streams.

lbzrecover – recover data from damaged bz2 files

Big bz2 files usually consist of more than one independent blocks. If some part of bz2 file becomes damaged, lbzrecover utility may be used to recover data from undamaged blocks.

lbzrecover scans input file and splits it into separate bz2 files which then can be tested and decompressed with lbzip2.

lbzgrep, lbzegrep, lbzfgrep – search compressed files

These commands allows grepping through lbzip2- and bzip2-compressed files, without having to decompress them first. The behavior is the same as grep, egrep and fgrep on uncompressed files.

lbzcmp, lbzdiff – compare compressed files

These utilities allow comparing compressed and uncompressed files. Any combination is supported, for example it is possible to compare one compressed and one uncompressed file, as well as two compressed files.

lbzless, lbzmore – page through compressed files

These tools allow displaying compressed wiles using with a pager tool without having to decompress them first.

lbzforce – force bz2 extension on compressed files

lbzforce examines files given as arguments. Any compressed files in bz2 format are renamed to have .bz2 suffix, unless they already have it.

lbzexe – compress executables

This tool allows compressing executables. Compression is usually very effective for huge shell scripts, as generated by certain build systems. Compressed executables are decompressed every time they are executed.

Relation to analogous tools

bzip2 and GNU zip (gzip) contain extra tools, which are similar in nature to lbzip2 utilities. The following table lists corresponding tools from lbzip2, bzip2 and gzip.

lbzcmp bzcmp zcmp
lbzdiff bzdiff zdiff
lbzegrep zegrep
lbzexe gzexe
lbzfgrep zfgrep
lbzforce zforce
lbzgrep bzgrep zgrep
lbzless bzless zless
lbzmore bzmore zmore
lbzrecover bzip2recover