XZ
From Just Solve the File Format Problem
(Difference between revisions)
m (Added link for magic bytes, only for FormatInfo.) |
|||
(13 intermediate revisions by 5 users not shown) | |||
Line 4: | Line 4: | ||
|extensions={{ext|xz}} | |extensions={{ext|xz}} | ||
|mimetypes={{mimetype|application/x-xz}} | |mimetypes={{mimetype|application/x-xz}} | ||
+ | |pronom={{PRONOM|fmt/1098}} | ||
+ | |wikidata={{wikidata|Q162839}} | ||
+ | |compression=lossless, mandatory | ||
+ | |magic=[https://github.com/file/file/blob/master/magic/Magdir/compress#L273 FD 37 7A 58 5A 00] | ||
+ | |released=2009<ref>[https://tukaani.org/xz/xz-file-format-1.0.0.txt The .xz File Format - Version 1.0.0 (2009-01-14) - tukaani.org]</ref> | ||
}} | }} | ||
'''XZ''' is a stream compression format with built-in integrity checks. It uses [[LZMA2]] compression. Compressed streams are able to be concatenated and still be decompressible like a single-stream file. | '''XZ''' is a stream compression format with built-in integrity checks. It uses [[LZMA2]] compression. Compressed streams are able to be concatenated and still be decompressible like a single-stream file. | ||
− | XZ files always have lengths that are multiples of 4 bytes, and they begin with a 6-byte "magic" sequence of (hex) FD 37 7A 58 5A 00 and end with footer "magic bytes" of 59 5A. (The ending bytes can be verified as a sign that the file has not been truncated in transmission.) | + | XZ is a successor to [[LZMA Alone|LZMA_Alone]] format, and an alternative to [[Lzip]]. The compression format is offered as an option among the likes of: |
+ | * [[vmlinuz]]<ref>[https://github.com/torvalds/linux/blob/master/scripts/extract-vmlinux#L52 extract-vmlinux shell script (line 52) - Linus Torvalds' kernel - GitHub]</ref>, | ||
+ | * [[initramfs]]<ref>[https://github.com/dracut-ng/dracut-ng/blob/main/man/dracut.conf.5.adoc?plain=1#L119-L123 dracut.conf.5.adoc - dracut-ng manual pages - GitHub]</ref><ref>[https://gitlab.archlinux.org/archlinux/mkinitcpio/mkinitcpio/-/blob/master/mkinitcpio.conf?ref_type=heads#L61-67 mkinitcpio.conf (lines 61-67) - mkinitcpio - Arch Linux GitLab]</ref><ref>[https://github.com/anatol/booster/blob/master/docs/manpage.md?plain=1#L57 manpage.md (line 57) - booster - GitHub]</ref>, | ||
+ | * [[SquashFS|<code>squashfs-tools</code>]]<ref>[https://github.com/plougher/squashfs-tools/blob/master/squashfs-tools/compressor.c#L31-L77 compressor.c (lines 31-77) - squashfs-tools - GitHub]</ref> | ||
+ | * As a specific switch <code>-J</code> or <code>--xz</code> in GNU [[tar]]<ref>[https://www.gnu.org/software/tar/manual/tar.html#gzip 8.1.1 Creating and Reading Compressed Archives - GNU tar 1.35 online manual (single page) - gnu.org]</ref> under [[Linux]]. | ||
+ | * [[DWARFS]] - mainly via liblzma<ref>[https://github.com/mhx/dwarfs/blob/main/src/compression/lzma.cpp lzma.cpp - DWARFS - GitHub]</ref> which on modern Linux installations, only [[LZMA2]] is used in place of [[LZMA]]. | ||
+ | |||
+ | == Identification == | ||
+ | XZ files always have lengths that are multiples of 4 bytes, and they begin with a 6-byte "magic" sequence of (hex) {{magic|FD 37 7A 58 5A 00}} and end with footer "magic bytes" of {{magic|59 5A}}. (The ending bytes can be verified as a sign that the file has not been truncated in transmission.) | ||
== Software == | == Software == | ||
− | * [ | + | * [[7-Zip]] |
* [http://7-zip.org/sdk.html LZMA SDK] | * [http://7-zip.org/sdk.html LZMA SDK] | ||
− | * [http://tukaani.org/xz/ XZ Utils] | + | * [http://tukaani.org/xz/ XZ Utils]: |
+ | ** <code>xz</code>, <code>unxz</code>, <code>xzcat</code>, etc. | ||
+ | ** <code>xzdec</code> | ||
+ | ** liblzma | ||
+ | * [http://tukaani.org/xz/embedded.html XZ Embedded] | ||
− | == | + | == Sample files == |
− | * [ | + | * {{DexvertSamples|archive/xz}} |
− | * [ | + | * [https://discmaster.textfiles.com/search?mode=deep&extension=.xz&family=archive&format=xz Search results of files with .xz extension, belongs to archive family and is the format xz - Discmaster.textfiles.com] |
+ | |||
+ | == Links == | ||
+ | * [https://tukaani.org/xz/xz-file-format.txt Current spec] | ||
+ | * [https://tukaani.org/xz/format.html Official site] (has historical specs with other info) | ||
* [[Wikipedia:xz|Wikipedia article]] | * [[Wikipedia:xz|Wikipedia article]] | ||
+ | * [https://www.nongnu.org/lzip/xz_inadequate.html Xz format inadequate for long-term archiving] - Analysis of weaknesses and design errors in the xz format, by the author of another format | ||
+ | |||
+ | == References == | ||
+ | <references/> |
Latest revision as of 10:58, 16 August 2025
XZ is a stream compression format with built-in integrity checks. It uses LZMA2 compression. Compressed streams are able to be concatenated and still be decompressible like a single-stream file.
XZ is a successor to LZMA_Alone format, and an alternative to Lzip. The compression format is offered as an option among the likes of:
- vmlinuz[2],
- initramfs[3][4][5],
-
squashfs-tools
[6] - As a specific switch
-J
or--xz
in GNU tar[7] under Linux. - DWARFS - mainly via liblzma[8] which on modern Linux installations, only LZMA2 is used in place of LZMA.
Contents |
[edit] Identification
XZ files always have lengths that are multiples of 4 bytes, and they begin with a 6-byte "magic" sequence of (hex) FD 37 7A 58 5A 00
and end with footer "magic bytes" of 59 5A
. (The ending bytes can be verified as a sign that the file has not been truncated in transmission.)
[edit] Software
- 7-Zip
- LZMA SDK
- XZ Utils:
-
xz
,unxz
,xzcat
, etc. -
xzdec
- liblzma
-
- XZ Embedded
[edit] Sample files
- dexvert samples — archive/xz
- Search results of files with .xz extension, belongs to archive family and is the format xz - Discmaster.textfiles.com
[edit] Links
- Current spec
- Official site (has historical specs with other info)
- Wikipedia article
- Xz format inadequate for long-term archiving - Analysis of weaknesses and design errors in the xz format, by the author of another format
[edit] References
- ↑ The .xz File Format - Version 1.0.0 (2009-01-14) - tukaani.org
- ↑ extract-vmlinux shell script (line 52) - Linus Torvalds' kernel - GitHub
- ↑ dracut.conf.5.adoc - dracut-ng manual pages - GitHub
- ↑ mkinitcpio.conf (lines 61-67) - mkinitcpio - Arch Linux GitLab
- ↑ manpage.md (line 57) - booster - GitHub
- ↑ compressor.c (lines 31-77) - squashfs-tools - GitHub
- ↑ 8.1.1 Creating and Reading Compressed Archives - GNU tar 1.35 online manual (single page) - gnu.org
- ↑ lzma.cpp - DWARFS - GitHub