LinuxCommandLibrary

xzcat

Decompress and print xz-compressed files to standard output

TLDR

View documentation for the original command

$ tldr xz
copy

SYNOPSIS

xzcat [FILE]...

PARAMETERS

-d, --decompress
    Forces decompression. Implied.

-z, --compress
    Forces compression. It results in error message.

-f, --force
    Forces overwrite of existing output files and (de)compression even if one input is read from a terminal.

-k, --keep
    Keep (don't delete) input files.

-q, --quiet
    Suppress warnings; specify twice to suppress errors too.

-v, --verbose
    Be verbose. Show the compression ratio, uncompressed size, etc.

--robot
    Produce output intended to be machine readable.

-h, --help
    Display help and exit.

-V, --version
    Display version information and exit.

[FILE]...
    The name of the .xz file(s) to decompress. If no file is specified, xzcat reads from standard input.

DESCRIPTION

The xzcat command decompresses .xz compressed files and writes the uncompressed data to standard output. It's effectively a shortcut for `xz -dc` or `xz --decompress --stdout`. This is useful for viewing the contents of compressed files without needing to save the uncompressed version to disk. Like `gzip`'s `zcat`, `bzip2`'s `bzcat`, and `lzma`'s `lzcat`, it facilitates piped processing: the output can be immediately piped to another command for further analysis or modification. xzcat handles concatenated files; if given multiple compressed files, it decompresses and concatenates them into a single stream to standard output. It can also decompress from standard input if no filename is provided, allowing for a chain of compression/decompression and other transformations. xzcat will exit with an error if the input file is not a valid .xz file or if the compressed data is corrupted.
This command is a part of the XZ Utils compression suite, which provides high compression ratios. The command is a filter utility that can transparently work with any program that reads data from standard input or writes data to standard output.

CAVEATS

If input is read from standard input, xzcat requires that the input is a .xz file; there is no automatic detection of the file format.
Error handling may not always be as robust as using the full `xz` command with appropriate options.

EXAMPLES

Display content of file archive.xz:
xzcat archive.xz

Display content of several files:
xzcat archive1.xz archive2.xz archive3.xz

Decompress from standard input and pipe it to command process:
cat archive.xz | xzcat | process

HISTORY

xzcat is part of the XZ Utils suite, which was developed as a successor to the LZMA compression format. LZMA was originally used in the 7-Zip archiver. XZ Utils provides improved compression ratios and integrity checking compared to older compression tools. The xz file format and tools have become widely adopted in Linux distributions for packaging and distribution of software and other data because of its efficient compression.

SEE ALSO

xz(1), gzip(1), gunzip(1), bzip2(1), bunzip2(1), lzma(1), unlzma(1)

Copied to clipboard