How to decompress tar.xz in Ubuntu

created at 12-27-2021 views: 6

tar.xz

Today I went to install nodejs on Ubuntu, the downloaded file node-v6.10.1-linux-x64.tar.xz

This is a two-layer compression, the outer layer is xz compression method, and the inner layer is tar compression

So it can be decompressed in two steps

$ xz -d node-v6.10.1-linux-x64.tar.xz
$ tar -xvf node-v6.10.1-linux-x64.tar

The compressed package xz format is smaller than 7z, but the compression time is longer

for xz

compression

xz -z filename: 

Unzip

xz -d filename:

for tar

compression

tar -cvf filename

Unzip

tar -xvf filename

direct decompress

In addition, you can also directly decompress

tar xvJf node-v6.10.1-linux-x64.tar.xz
created at:12-27-2021
edited at: 12-27-2021: