lzmainfo
Display information about LZMA/XZ files
SYNOPSIS
lzmainfo [option] [file...]
PARAMETERS
-h, --help
Displays a help message outlining the command's usage and options, then exits.
-V, --version
Prints the version number of the lzmainfo utility and exits.
DESCRIPTION
lzmainfo is a command-line utility used to display detailed information about files compressed with the LZMA (Lempel–Ziv–Markov chain algorithm) compression algorithm. It reads the header of an .lzma file and extracts critical properties such as the uncompressed size of the original data, the compressed size of the file itself, the achieved compression ratio, and the dictionary size used during the compression process. This tool is invaluable for quickly inspecting .lzma archives without requiring the entire file to be decompressed, which can be time-consuming for large files.
It helps users to verify the integrity of the file's header information, understand the parameters used for compression, or simply obtain quick statistics. While the .lzma format has largely been superseded by the more advanced .xz format (which uses LZMA2), lzmainfo remains a useful tool for managing and inspecting legacy .lzma archives. It is typically part of the xz utilities package, providing a cohesive set of tools for handling both LZMA and LZMA2 compressed data.
CAVEATS
lzmainfo is specifically designed for the older .lzma file format and does not directly support the newer .xz format (which uses the LZMA2 algorithm), although the overarching xz command suite can handle both. The command only reads the file header and does not perform full decompression, meaning it cannot detect data corruption or errors within the compressed payload itself, only issues with the header information. If the .lzma file header is corrupted or incomplete, lzmainfo may fail to provide accurate information or report an error.
OUTPUT FORMAT
The default output of lzmainfo provides several key pieces of information about the .lzma file:
Uncompressed size: The size of the data before it was compressed.
Compressed size: The size of the file after LZMA compression.
Ratio: The compression ratio achieved, typically expressed as a percentage.
Dictionary size: The size of the dictionary (in MiB or KiB) used during compression, which is crucial for decompression.
Number of filters: Indicates the number of filters applied, typically 1 for standard LZMA.
For example, running lzmainfo my_document.lzma
might produce output similar to:Uncompressed size: 1234567, Compressed size: 456789, Ratio: 37.0%, Dictionary size: 8 MiB, Filters: 1
PACKAGE INFORMATION
On most Linux distributions, lzmainfo is provided as part of the xz-utils package (commonly found on Debian, Ubuntu, and derivatives) or simply the xz package (typical for Fedora, RHEL, and Arch Linux). Installing this package provides a complete suite of tools including xz, unxz, lzma, unlzma, and lzmainfo, ensuring comprehensive support for LZMA and LZMA2 compression formats.
HISTORY
The LZMA (Lempel–Ziv–Markov chain algorithm) compression algorithm was originally developed by Igor Pavlov and introduced as a core component of the 7-Zip archiver in 1998. The command-line utilities for LZMA, including lzmainfo, originated from the LZMA SDK. As compression technology evolved, the LZMA2 algorithm was developed, offering improvements in performance and features. This led to the creation of the xz command-line utilities, which aimed to provide a modern and unified suite of compression tools for Linux and Unix-like systems. lzmainfo was integrated into the xz utilities package, ensuring backward compatibility for users needing to inspect older .lzma archives while encouraging the adoption of the newer .xz format for new compression tasks.