# How to extract .xz files?

**URL:** <https://linux-tips.com/t/how-to-extract-xz-files/265>\
**Category:** Shell\
**Created:** [August 21, 2015, 8:07pm UTC](https://linux-tips.com/t/how-to-extract-xz-files/265 "2015-08-21T20:07:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Greg](https://linux-tips.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@Greg](https://linux-tips.com/u/Greg)\
**Post date:** [August 21, 2015, 8:07pm UTC](https://linux-tips.com/t/how-to-extract-xz-files/265/1 "2015-08-21T20:07:24Z")

</div>

I can extract `.tar.xz` files with `xf` parameters below:

```
$ tar xf file.tar.xz

```

But, what is the correct way to extract single `.xz` files in console?

---

<div class="post-metadata">

**Author:** ![RaskoX](https://linux-tips.com/user_avatar/linux-tips.com/raskox/32/92_2.png) [@RaskoX](https://linux-tips.com/u/RaskoX)\
**Post date:** [August 21, 2015, 8:14pm UTC](https://linux-tips.com/t/how-to-extract-xz-files/265/2 "2015-08-21T20:14:42Z")

</div>

You have to install `xz-utils` package first:

```
$ sudo apt-get install xz-utils

```

You can use `unxz` command to extract .xz files:

```
$ unxz file.xz

```

or using with `--decompress` option of `xz`:

```
$ xz --decompress file.xz
```

---

<div class="post-metadata">

**Author:** ![ChristianC123](https://linux-tips.com/letter_avatar_proxy/v4/letter/c/e36b37/32.png) [@ChristianC123](https://linux-tips.com/u/ChristianC123)\
**Post date:** [September 19, 2017, 9:31pm UTC](https://linux-tips.com/t/how-to-extract-xz-files/265/3 "2017-09-19T21:31:38Z")

</div>

tar supports .xz from version **1.22** onwards, please update the version

```auto
$ tar xvf filename.tar.xz

```

Regards,  
Christian
