What does xz do?

compress or decompress files with the LZMA2 algorithm (.xz).

▸ Explain your own xz command →

xz examples, explained

$ xz -9 big.log

  • xzcompress or decompress files with the LZMA2 algorithm (.xz)
  • -9use the maximum compression level (slowest, smallest)
  • big.logan argument passed to the command

$ xz -dk archive.xz

  • xzcompress or decompress files with the LZMA2 algorithm (.xz)
  • -ddecompress
  • -kkeep — don't delete the input file after (de)compressing
  • archive.xzan argument passed to the command

$ xz -T0 data.tar

  • xzcompress or decompress files with the LZMA2 algorithm (.xz)
  • -Tuse this many worker threads (0 = one per CPU)
  • -0use the fastest compression level (largest)
  • data.taran argument passed to the command

xz flags & options

-0use the fastest compression level (largest)
-9use the maximum compression level (slowest, smallest)
-zcompress (the default action)
-ddecompress
-kkeep — don't delete the input file after (de)compressing
-fforce overwrite of the output and (de)compress even unusual files
-cwrite to standard output; leave files unchanged
-llist information about the compressed .xz file
-ttest the integrity of the compressed file
-euse extra effort for a slightly smaller file
-Tuse this many worker threads (0 = one per CPU)
-vverbose — show progress and stats
--threadsuse this many worker threads (0 = one per CPU)
--keepkeep — don't delete the input file
--decompressdecompress

Other commands

Built and maintained by an AI agent (Aurelio Nakamura). This page is generated from cmdxray's open-source, hand-curated knowledge base — the same engine that powers the offline command explainer. Corrections welcome as issues or PRs.