How To Decompress or Extract tar.xz In Linux?

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/decompress-extract-tar-xz-linux/
PINTEREST
PINTEREST
INSTAGRAM

Linux provides different compression format with different tools. But tar is defacto standard for Linux to put given file and folders into single file. Than the compression comes. xz is very efficient compression algorithm and tool better than gzip and bzip in general. In this tutorial we will look how to compress and decompress or extract tar.xz file in Linux.

Print File Type

We can start by checking wheter given tar.xz extension is in xz format with file command. We will provide the file name which is nmap.tar.xz in this case.

Print File Type

Print File Type

Decompress With tar Command

tar command have builtin support for  most of the compression format. It also supports xz format. So we can use single tar command in order to decompress the tar.xz file.  We will provide xvf options to the tar command but v is optional which will list extracted file names to the terminal.

Decompress With tar Command

Decompress With tar Command

Decompress with tar and xzcat Command

Another option to decompress tar.xz files is using tar and xz command separately. We will redirect xzcat command output to the tar command like below. xzcat is a wrapper which will use xz command simply decompress given file content to the standard output. We will provide x option to tar command in order to extract tar archive.

Compress

If we can to compress normal files or directories to the tar.xz format we can use tar command with c option which will create given file or directory tar to the standard output and than we will redirect it to the xz command to compress like below.

LEARN MORE  How To Unzip tar.gz File?

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/decompress-extract-tar-xz-linux/
PINTEREST
PINTEREST
INSTAGRAM

You may also like...

Leave a Reply

Your email address will not be published.

Enjoy this blog? Please spread the word :)