XZ Utils is free general-purpose data compression software with high compression ratio. XZ Utils were written for POSIX-like systems, but also work on some not-so-POSIX systems. XZ Utils are the successor to LZMA Utils.
# Compress a file
xz file.txt
# Compress with maximum compression
xz -9 file.txt
# Compress keeping the original file
xz -k file.txt
# Decompress a file
unxz file.txt.xz
# Decompress to standard output
xzcat file.txt.xz
# Compress with custom dictionary size
xz --dict-size=64MiB file.txt
# Compress with multiple threads
xz -T4 file.txt
# Test integrity of compressed file
xz -t file.txt.xz
The liblzma library provides a C API for applications to integrate XZ compression capabilities. Header files are installed in ${PREFIX}/include/lzma/ and the library can be linked with -llzma.
XZ Utils is distributed under multiple libre licenses:
You can choose to use the software under any of these licenses.
Comprehensive man pages are available for all commands and the library API. Additional documentation and examples can be found in ${PREFIX}/share/doc/xz/.
For more details, visit the official website: https://tukaani.org/xz/