Faced with a file of type tar.xz. What is it and how to unpack it?

  • Most likely tar is, but not necessarily. To be sure it is worth seeing the contents. By the first characters of the signature, you can often determine the format. Because it can be an arbitrary file with any data and not necessarily an archive. - Isaev

3 answers 3

xz is a file compression format using the LZMA algorithm. To use on Ubunt, you need to install xz-utils.

Installation:

sudo apt-get install xz-utils 

Unpacking:

 tar -xpJf archive.tar.xz 
  • It seemed to me that there was already everything for that. At least in FreeBSD, this can be done without installing additional software. - Sergey
  • one
    I worked for installation buz add. of packages (Ubuntu 16.04) like this: sudo tar -xvf ARCHIVE -C PATH - heroys6

Further, in order not to care about what type of archive, you can put the utility atool:

 $ sudo apt-get install atool 

To unpack (show by 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 etc.

    there is a universal solution.

    all popular distributions of the gnu / linux operating system have a dtrx package (“do the right extraction”). when it is installed according to dependencies, the unpackers missing in the system will also be installed.

    the program determines what is inside the file and can unpack tar, zip (including self-extracting. exe), cpio, rpm, deb, gem, 7z, cab, rar, files created by InstallShield, compressed gzip, bzip2, lzma and compress.

    if other archives / compressed files are found inside the archive, the program will interactively offer to unpack them too.

    using:

     $ dtrx сжатый.файл.и.или.архив 

    developer page

    man dtrx