← 返回命令列表

Linux command

xzcat 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

View contents

xzcat [file.xz]

View contents of a .lzma file

xzcat [file.lzma]

Pipe to another command

xzcat [file.xz] | grep "[pattern]"

Test file integrity

xzcat -t [file.xz]

Verbose output

xzcat -v [file.xz]

Decompress multiple files

xzcat [file1.xz] [file2.xz]

说明

xzcat decompresses .xz and .lzma files and writes the uncompressed data to standard output. It is equivalent to running xz --decompress --stdout or xz -dc. The XZ format uses LZMA2 compression algorithm and provides better compression ratios than gzip or bzip2, though at the cost of slower compression speed. Decompression is relatively fast. xzcat reads from standard input if no files are specified or if - is given as a filename.

参数

-f, --force
Force decompression even if input doesn't appear to be in .xz format.
-k, --keep
Keep input files (they're not deleted anyway with xzcat).
-t, --test
Test compressed file integrity without outputting data.
-q, --quiet
Suppress warnings and non-fatal error messages.
-v, --verbose
Display filename and statistics during processing.
--memlimit=_limit_
Set memory usage limit for decompression.
--format=_format_
Restrict to specific format: xz, lzma, raw, auto.
-h, --help
Display help message and exit.
-V, --version
Display version information and exit.

FAQ

What is the xzcat command used for?

xzcat decompresses .xz and .lzma files and writes the uncompressed data to standard output. It is equivalent to running xz --decompress --stdout or xz -dc. The XZ format uses LZMA2 compression algorithm and provides better compression ratios than gzip or bzip2, though at the cost of slower compression speed. Decompression is relatively fast. xzcat reads from standard input if no files are specified or if - is given as a filename.

How do I run a basic xzcat example?

Run `xzcat [file.xz]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -f, --force do in xzcat?

Force decompression even if input doesn't appear to be in .xz format.