unlzma
Decompress .lzma files
TLDR
View documentation for the original command
SYNOPSIS
unlzma [OPTION]... [FILE]...
PARAMETERS
-d, --decompress, --uncompress
Decompress the file. This option is implicitly enabled when unlzma is invoked, as its sole purpose is decompression.
-f, --force
Force overwrite of existing output files. This allows decompressing to a file that already exists without prompting the user for confirmation.
-k, --keep
Keep (do not delete) the original input compressed file after successful decompression. By default, unlzma deletes the original .lzma file upon completion.
-c, --stdout, --to-stdout
Write decompressed output to standard output (stdout). When this option is used, the original input file is not deleted, even if -k is not specified. This is useful for piping output to other commands.
-q, --quiet
Suppress all warnings and messages. Only critical errors are reported, making it suitable for use in scripts where minimal output is desired.
-v, --verbose
Display more information during the decompression process, such as progress indications, input and output file sizes, and compression ratios.
--help
Display a help message that details command-line options and usage, then exit.
--version
Display version information for the unlzma (or underlying xz) utility, then exit.
DESCRIPTION
unlzma is a command-line utility primarily used to decompress files that have been compressed using the LZMA (Lempel-Ziv-Markov chain Algorithm) compression algorithm, typically identified by the .lzma file extension.
It is commonly implemented as a symbolic link to the more modern and versatile xz command. When invoked as unlzma, the xz utility automatically behaves as if the options --decompress --lzma (or -d --format=lzma) were specified. This makes unlzma a convenient and straightforward alias for handling LZMA-specific archives without needing to explicitly provide format options to xz.
The command reads compressed data from standard input if no file is specified, or from one or more specified files. It then writes the decompressed data to standard output or to a new file, usually by removing the .lzma suffix from the input filename. unlzma is crucial for interoperability with older systems and archives that exclusively use the LZMA format.
CAVEATS
unlzma is typically a symbolic link to the more versatile xz command. As such, its behavior and available options are primarily governed by xz. While unlzma specifically targets .lzma files, it does not prevent decompressing other formats if xz's auto-detection is enabled or if invoked directly as xz -d. By default, unlzma deletes the original compressed file upon successful decompression, which can be prevented using the -k or --keep option. It's important to note that for .xz files, unxz or xz -d is the more appropriate command.
INPUT AND OUTPUT HANDLING
By default, unlzma reads compressed data from the specified FILE arguments. If no files are provided or if a single hyphen (-) is used as a filename, it reads from standard input (stdin). The decompressed output is written to standard output (stdout) if the -c or --stdout option is used, or if input is from stdin. Otherwise, the decompressed data is written to a new file, typically with the .lzma suffix removed from the input filename. For example, file.txt.lzma would decompress to file.txt.
HISTORY
The LZMA (Lempel-Ziv-Markov chain Algorithm) compression algorithm was developed by Igor Pavlov as part of the 7-Zip archiver project, gaining recognition for its high compression ratios. The standalone lzma command-line utility then emerged. Later, the xz utility was developed as a modern and more robust successor to lzma, designed to handle both the original LZMA stream format and the newer XZ container format, offering improved error checking and multi-stream support. The unlzma command subsequently emerged as a convenient alias or symbolic link to xz (or the original lzma in older systems), specifically configured to decompress files using the legacy LZMA format, simplifying its usage for users familiar with the original lzma tools.