Files
cheatsheet-tldr/tldr/xz
2024-03-15 00:13:13 +00:00

42 lines
797 B
Plaintext

---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# xz
> Compress or decompress XZ and LZMA files.
> More information: <https://manned.org/xz>.
- Compress a file using xz:
`xz {{path/to/file}}`
- Decompress an XZ file:
`xz --decompress {{path/to/file.xz}}`
- Compress a file using lzma:
`xz --format=lzma {{path/to/file}}`
- Decompress an LZMA file:
`xz --decompress --format=lzma {{path/to/file.lzma}}`
- Decompress a file and write to `stdout` (implies `--keep`):
`xz --decompress --stdout {{path/to/file.xz}}`
- Compress a file, but don't delete the original:
`xz --keep {{path/to/file}}`
- Compress a file using the fastest compression:
`xz -0 {{path/to/file}}`
- Compress a file using the best compression:
`xz -9 {{path/to/file}}`