LinuxCommandLibrary

xzmore

View xz-compressed files, like 'more'

TLDR

View a compressed file

$ xzmore [path/to/file]
copy

SYNOPSIS

xzmore [file...]
All options are passed to the pager program (e.g., more).

PARAMETERS

file...
    One or more .xz or .lzma compressed files to view. If omitted, standard input is read.

[options]
    Any options provided on the command line are passed directly to the underlying pager program (e.g., more or less). Refer to the pager's manual for available options.

DESCRIPTION

xzmore is a utility designed to allow users to view the contents of files compressed with .xz or .lzma without needing to decompress them permanently to disk. It functions by piping the output of xzcat (or unxz) directly into a pager program, typically more (or less if more is not available or explicitly configured). This provides a convenient way to inspect large compressed text files incrementally, making it an essential tool for system administrators and developers working with compressed logs or data. If no filenames are provided, xzmore reads from standard input, making it highly versatile for use in command pipelines where compressed data is streamed. Its primary advantage is avoiding the temporary creation of uncompressed files, saving disk space and reducing I/O operations.

CAVEATS

xzmore relies on the availability of xzcat (or unxz) and a pager program (like more or less) on the system. Its behavior and available functionalities for navigation and searching are entirely dependent on the specific pager configured (e.g., via the PAGER environment variable). It is primarily designed for text files and may not display binary files meaningfully.

ENVIRONMENT VARIABLES

The behavior of xzmore can be influenced by the PAGER environment variable. If set, xzmore will use the program specified by this variable as its pager instead of the default (typically more). For example, setting export PAGER=less would make xzmore use less for pagination, which offers more advanced features.

HISTORY

xzmore is part of the xz utilities package, which provides a suite of tools for handling .xz and .lzma compressed files. The xz format itself is a modern, high-compression ratio successor to the older lzma format and is widely used in Linux distributions for software packages, archives, and system logs. xzmore emerged as a convenient front-end, similar to zmore for gzip files, allowing users to quickly inspect compressed content without full decompression, fitting into the standard Unix philosophy of small, focused tools.

SEE ALSO

xz(1), xzcat(1), unxz(1), more(1), less(1)

Copied to clipboard