Unpacking the tar.xz archive
I encountered an archive of the tar.xz type. What is it and how do I unpack it?
4 answers
Xz is a file format for data compression using the LZMA algorithm. To use it on Ubuntu, you need to install xz-utils.
Installation:
sudo apt-get install xz-utils
Unpacking:
tar -xpJf archive.tar.xz
In the future, in order not to care about what type of archive, you can install the atool utility:
$ sudo apt-get install atool
For unpacking (I'll show you with examples):
$ aunpack a.7z
$ aunpack a.tag.gz
$ aunpack a.zip
For archiving:
$ apack a.7z file1.txt file2 dir1
To view the content:
$ als a.7z
And others
There is also a universal solution.
All popular distributions of the gnu/linux operating system have the package dtrx ("do the right extraction"). when you install it by dependencies, the missing unpackers in the system will also be installed.
The program independently determines what is inside the file, and is able to unpack tar, zip (including self-extracting .exe), cpio, rpm, deb, gem, 7z, cab, rar, files created by InstallShield, compressed by gzip, bzip2, lzma and compress.
If other archives are found inside the archive/compressed files, the program interactively prompts you to unpack them as well.
Using:
$ dtrx сжатый.файл.и.или.архив
On Linux, there is unar
, which unpacks everything and normally processes the Russian encoding in zip
. Also suitable for tar.xz
.