XZ Utils
   HOME

TheInfoList



OR:

XZ Utils (previously LZMA Utils) is a set of
free software Free software or libre software is computer software distributed under terms that allow users to run the software for any purpose as well as to study, change, and distribute it and any adapted versions. Free software is a matter of liberty, n ...
command-line A command-line interpreter or command-line processor uses a command-line interface (CLI) to receive commands from a user in the form of lines of text. This provides a means of setting parameters for the environment, invoking executables and pro ...
lossless data compressors, including the programs lzma and xz, for
Unix-like A Unix-like (sometimes referred to as UN*X or *nix) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Unix-li ...
operating systems and, from version 5.0 onwards,
Microsoft Windows Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for ...
. For compression/decompression the
Lempel–Ziv–Markov chain algorithm The Lempel–Ziv–Markov chain algorithm (LZMA) is an algorithm used to perform lossless data compression. It has been under development since either 1996 or 1998 by Igor Pavlov and was first used in the 7z format of the 7-Zip archiver. This ...
(LZMA) is used. XZ Utils started as a Unix port of Igor Pavlov's LZMA- SDK that has been adapted to fit seamlessly into Unix environments and their usual structure and behavior.


Features

In most cases, xz achieves higher compression rates than alternatives like gzip and bzip2. Decompression speed is higher than bzip2, but lower than gzip. Compression can be much slower than gzip, and is slower than bzip2 for high levels of compression, and is most useful when a compressed file will be used many times. XZ Utils consists of two major components: * , the command-line compressor and decompressor (analogous to gzip) * liblzma, a
software library In computer science, a library is a collection of non-volatile resources used by computer programs, often for software development. These may include configuration data, documentation, help data, message templates, pre-written code and sub ...
with an API similar to zlib Various command shortcuts exist, such as (for ), (for ; analogous to ) and (for ; analogous to ) XZ Utils can compress and decompress both the ''xz'' and ''lzma'' file formats, but since the LZMA format is now
legacy In law, a legacy is something held and transferred to someone as their inheritance, as by will and testament. Personal effects, family property, marriage property or collective property gained by will of real property. Legacy or legacies may refer ...
, XZ Utils compresses by default to xz.


Usage

Both the behavior of the software as well as the properties of the file format have been designed to work similarly to those of the popular Unix compressing tools gzip and bzip2. Just like gzip and bzip, xz and lzma can only compress single files (or data streams) as input. They cannot bundle multiple files into a single
archive An archive is an accumulation of historical records or materials – in any medium – or the physical facility in which they are located. Archives contain primary source documents that have accumulated over the course of an individual ...
– to do this an archiving program is used first, such as
tar Tar is a dark brown or black viscous liquid of hydrocarbons and free carbon, obtained from a wide variety of organic materials through destructive distillation. Tar can be produced from coal, wood, petroleum, or peat. "a dark brown or black bi ...
. Compressing an archive: xz my_archive.tar # results in my_archive.tar.xz lzma my_archive.tar # results in my_archive.tar.lzma Decompressing the archive: unxz my_archive.tar.xz # results in my_archive.tar unlzma my_archive.tar.lzma # results in my_archive.tar Version 1.22 or greater of the
GNU GNU () is an extensive collection of free software (383 packages as of January 2022), which can be used as an operating system or can be used in parts with other operating systems. The use of the completed GNU tools led to the family of operat ...
implementation of tar has transparent support for tarballs compressed with lzma and xz, using the switches or for xz compression, and for LZMA compression. Creating an archive and compressing it: tar -c --xz -f my_archive.tar.xz /some_directory # results in my_archive.tar.xz tar -c --lzma -f my_archive.tar.lzma /some_directory # results in my_archive.tar.lzma Decompressing the archive and extracting its contents: tar -x --xz -f my_archive.tar.xz # results in /some_directory tar -x --lzma -f my_archive.tar.lzma # results in /some_directory Single-letter tar example for archive with compress and decompress with extract using short suffix: tar cJf keep.txz keep # archive then compress the directory ./keep/ into the file ./keep.txz tar xJf keep.txz # decompress then extract the file ./keep.txz creating the directory ./keep/ xz has supported multi-threaded compression (with the flag) since 2014, version 5.2.0.; since version 5.4.0 threaded decompression has been implemented. Threaded decompression requires multiple compressed blocks within a stream which are created by the threaded compression interface. The number of threads can be less than defined if the file is not big enough for threading with the given settings or if using more threads would exceed the memory usage limit.


The xz format

The xz format improves on lzma by allowing for preprocessing filters. The exact filters used are similar to those used in 7z, as 7z's filters are available in the public domain via the LZMA SDK.


Development and adoption

Development of XZ Utils took place within the Tukaani Project, which was led by Mike Kezner, by a small group of developers who once maintained a
Linux distribution A Linux distribution (often abbreviated as distro) is an operating system made from a software collection that includes the Linux kernel and, often, a package management system. Linux users usually obtain their operating system by downloading one ...
based on Slackware. All of the
source code In computing, source code, or simply code, is any collection of code, with or without comments, written using a human-readable programming language, usually as plain text. The source code of a program is specially designed to facilitate the ...
for xz and liblzma has been released into the
public domain The public domain (PD) consists of all the creative work to which no exclusive intellectual property rights apply. Those rights may have expired, been forfeited, expressly waived, or may be inapplicable. Because those rights have expired ...
. The XZ Utils source distribution additionally includes some optional scripts and an example program that are subject to various versions of the GPL. Specifically, the full list of GPL scripts and sources distributed with the XZ Utils software include: * An optional implementation of a common libc function,
getopt Getopt is a C library function used to parse command-line options of the Unix/POSIX style. It is a part of the POSIX specification, and is universal to Unix-like systems. It is also the name of a Unix program for parsing command line argument ...
( GNU GPL v2 and GNU LGPL v2.1) * An m4 script for pthread detection ( GNU GPL v3) * Some nonessential wrapper scripts (xzgrep, etc) ( GNU GPL v2) * And the example program scanlzma, which is not integrated with the build system The resulting software xz and liblzma binaries are public domain, unless the optional LGPL
getopt Getopt is a C library function used to parse command-line options of the Unix/POSIX style. It is a part of the POSIX specification, and is universal to Unix-like systems. It is also the name of a Unix program for parsing command line argument ...
implementation is incorporated. Binaries are available for
FreeBSD FreeBSD is a free and open-source Unix-like operating system descended from the Berkeley Software Distribution (BSD), which was based on Research Unix. The first version of FreeBSD was released in 1993. In 2005, FreeBSD was the most popular ...
,
NetBSD NetBSD is a free and open-source Unix operating system based on the Berkeley Software Distribution (BSD). It was the first open-source BSD descendant officially released after 386BSD was forked. It continues to be actively developed and is ava ...
,
Linux Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, whi ...
systems,
Microsoft Windows Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for ...
, and FreeDOS. A number of
Linux distribution A Linux distribution (often abbreviated as distro) is an operating system made from a software collection that includes the Linux kernel and, often, a package management system. Linux users usually obtain their operating system by downloading one ...
s, including
Fedora A fedora () is a hat with a soft brim and indented crown.Kilgour, Ruth Edwards (1958). ''A Pageant of Hats Ancient and Modern''. R. M. McBride Company. It is typically creased lengthwise down the crown and "pinched" near the front on both side ...
, Slackware,
Ubuntu Ubuntu ( ) is a Linux distribution based on Debian and composed mostly of free and open-source software. Ubuntu is officially released in three editions: '' Desktop'', ''Server'', and ''Core'' for Internet of things devices and robots. All ...
, and
Debian Debian (), also known as Debian GNU/Linux, is a Linux distribution composed of free and open-source software, developed by the community-supported Debian Project, which was established by Ian Murdock on August 16, 1993. The first version of De ...
use xz for compressing their software packages. Arch Linux previously used xz to compress packages, but as of December 27, 2019, packages are compressed with Zstandard compression. The
GNU GNU () is an extensive collection of free software (383 packages as of January 2022), which can be used as an operating system or can be used in parts with other operating systems. The use of the completed GNU tools led to the family of operat ...
FTP archive also uses xz.


References


External links


Official Website

SourceForge project page
{{DEFAULTSORT:Xz Utils Free data compression software Free software programmed in C Public-domain software with source code Unix archivers and compression-related utilities