Skip to content
Latchkey

xzcat: Stream xz Files to stdout in CI

xzcat decompresses a .xz file to stdout without touching disk, equivalent to unxz -c, so you can pipe .xz release tarballs and logs directly.

xzcat is the .xz member of the *cat family. It streams .tar.xz release archives into tar and greps compressed logs with no scratch file.

What it does

xzcat reads one or more .xz files and writes their decompressed contents to stdout, the same as unxz -c or xz -dc. It also reads legacy .lzma on most builds. Nothing is written to disk, which suits piping.

Common usage

Terminal
xzcat linux.tar.xz | tar -t          # list without extracting
xzcat app.log.xz | grep -i fail
xzcat release.tar.xz | tar -x        # extract via a pipe
xzcat a.xz b.xz > combined.txt

Options

ItemWhat it does
xzcat <file.xz>Decompress to stdout (like unxz -c)
-T0 / --threads=0Use multiple cores where the stream allows
multiple filesConcatenate all decompressed outputs
.lzma supportReads legacy lzma streams on most builds

In CI

Pipe xzcat into tar (xzcat rel.tar.xz | tar -x) to extract without a temp file. It ships with xz-utils, so installing xz-utils provides it. For big multi-block .xz, -T0 can speed the decode.

Common errors in CI

"xz: (stdin): File format not recognized" means the input is not xz or lzma; use zcat, bzcat, or zstdcat for the real format. "Unexpected end of input" is a truncated download. "command not found" means xz-utils is not installed.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →