← 返回命令列表

Linux command

unxz 命令

文件

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

常用示例

Decompress file

unxz [file.xz]

Keep original

unxz -k [file.xz]

To stdout

unxz -c [file.xz]

Force overwrite

unxz -f [file.xz]

Decompress multiple

unxz [file1.xz] [file2.xz]

说明

unxz decompresses files that were compressed with the XZ format, which uses the LZMA2 algorithm for high compression ratios. It is functionally equivalent to running xz --decompress and is provided as a convenience command within the xz-utils package. By default, unxz replaces the compressed .xz file with the decompressed output, removing the original. The -k flag preserves the original compressed file, and -c writes decompressed data to standard output for piping to other commands. XZ is widely used in the Linux ecosystem for distributing source code tarballs, kernel sources, and package archives due to its excellent compression ratio. While decompression is fast, XZ compression is slower and more memory-intensive than alternatives like gzip or zstd.

参数

-k
Keep original.
-c
Write to stdout.
-f
Force overwrite.
-v
Verbose mode.
-q
Quiet mode.

FAQ

What is the unxz command used for?

unxz decompresses files that were compressed with the XZ format, which uses the LZMA2 algorithm for high compression ratios. It is functionally equivalent to running xz --decompress and is provided as a convenience command within the xz-utils package. By default, unxz replaces the compressed .xz file with the decompressed output, removing the original. The -k flag preserves the original compressed file, and -c writes decompressed data to standard output for piping to other commands. XZ is widely used in the Linux ecosystem for distributing source code tarballs, kernel sources, and package archives due to its excellent compression ratio. While decompression is fast, XZ compression is slower and more memory-intensive than alternatives like gzip or zstd.

How do I run a basic unxz example?

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

What does -k do in unxz?

Keep original.