LinuxCommandLibrary

bzless

View bzip2 compressed files without decompressing

SYNOPSIS

bzless [less-options] [compressed-file ...]

PARAMETERS

--help
    Display help and exit

--version
    Output version information and exit

-V
    Synonym for --version

less options
    All remaining options passed directly to less(1)

DESCRIPTION

bzless is a convenience wrapper for viewing files compressed with bzip2. It automatically decompresses one or more .bz2 files on the fly and pipes the output to the less pager, enabling efficient navigation without extracting to disk. This is ideal for large compressed logs, manuals, or data files.

Usage mirrors less: search with /?, scroll with arrow keys, quit with q. Multiple files are handled sequentially, with less menus for switching (:n, :p). If no files are specified, it reads from stdin, decompressing if compressed and not a terminal.

bzless detects common extensions like .bz2, .bz, .tbz, .tbz2, .tb2. It's part of the bzip2 package, transparent to less options for familiarity. Saves time and space over manual bunzip2 | less.

CAVEATS

Assumes text content; binary files display poorly.
Does not decompress password-protected or multi-part bzip2 archives.
Relies on bzip2 for decompression; errors if corrupted.

SUPPORTED EXTENSIONS

.bz2, .bz, .tbz, .tbz2, .tb2, .tbz2; auto-detects bzip2 streams.

STDIN HANDLING

Reads/decompresses from pipe if not tty; otherwise pipes to less.

HISTORY

Introduced with bzip2 1.0 in September 1996 by Julian Seward as a script wrapper. Evolved with bzip2 releases; current in version 1.0.8 (2019). Widely available on Linux distros via bzip2 package.

SEE ALSO

less(1), bzip2(1), bunzip2(1), zless(1), bzmore(1)

Copied to clipboard