Yes. See man xz
:
NAME
xz, unxz, xzcat, lzma, unlzma, lzcat - Compress or decompress .xz and
.lzma files
SYNOPSIS
xz [option...] [file...]
COMMAND ALIASES
unxz is equivalent to xz --decompress.
xzcat is equivalent to xz --decompress --stdout.
lzma is equivalent to xz --format=lzma.
unlzma is equivalent to xz --format=lzma --decompress.
lzcat is equivalent to xz --format=lzma --decompress --stdout.
[. . .]
So you just want unxz archive.tar.xz
or xz --decompress archive.tar.xz
.
Note that tar
can do all this for you, there's no reason to first create a tar archive and then compress it, you can create it compressed:
tar -cJvf archive.tar file[1-5].txt
That will produce archive.tar.xz
. From man tar
:
-J, --xz
Filter the archive through xz(1).
You can then decompress in one step to get the original files back with:
tar -xJvf archive.tar.xz