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
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.txtOptions
| Item | What it does |
|---|---|
| xzcat <file.xz> | Decompress to stdout (like unxz -c) |
| -T0 / --threads=0 | Use multiple cores where the stream allows |
| multiple files | Concatenate all decompressed outputs |
| .lzma support | Reads 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.