Back to the command reference

xz

ArchivesFundamentalsReference only

Compress with xz (high ratio)

Name: xz: an LZMA2 compressor

This command is outside what the site lets you practise (mostly distribution-specific or rarely used tools). This page describes how to use it; try it on your own Linux system.

Description

xz uses LZMA2 and achieves the best ratio of the common tools; many packages and kernel tarballs use it. The cost is slower compression and more memory; -T0 uses all cores.

Syntax

xz [OPTION]... FILE...

Common options

-d / --decompressDecompress
-k / --keepKeep the original
-c / --stdoutWrite to standard output
-T0Use all CPU cores
-0 … -9Level: -0 fastest, -9 smallest (-6 by default)
-e / --extremeSpend more time for a little more compression
-l / --listShow information about the file
-t / --testCheck that the file is intact
-v / --verboseShow progress

Examples

  • $ xz -k -T0 big.tar

    Multi-threaded compression

    Explain

Related