How to tgz linux

How to Extract and Install .tar.gz Files in Linux

Linux is the operating system with more kinds of packages. If you have used Debian, you should know the file type .deb. If you have used Fedora, you should know the file type .rpm. In Linux we have many file types when we talk about installation packages and surely you’ll learn to install .tar.gz packages.

Table of contents

What is .tar.gz or .tgz?

​Tar isn’t an installation package but a computer software utility for collecting many files into one archive file. It is often referred to as a tarball for distribution or backup purposes. So .tar.gz is just a file format.Tar is often used together with a compression method, such as gzip, to create a compressed archive and file.tar.gz (or file.tgz).

Tarballs are often used to distribute the source code of an application or maybe a binary file to execute a program. You should consider finding an alternative before installing a tar.gz package because sometimes the process is longer and tougher.

How to install .tar.gz or .tgz file in Linux

If you need to install .tar.gz or .tgz package don’t worry, we have the solution.

extract tar.gz or tgz file in linux

I need to use WaoN because I play the guitar and want to transcribe the audio to a midi file, but WaoN isn’t available for my distro. So I have downloaded the source code to my computer, and the tarball’s content.

​To extract the files of a tarball, you can use the command: tar xvf tarball.tar.gz. Also, you should find more information about Tar here.

cd into the tar extracted directory

Now enter into the extracted directory:

​Commonly the tar.gz package contains a file with the instructions to compile and execute the program. My package contains a file called ‘INSTALL’ with the instructions:

Читайте также:  Linux получить время создания файла

read text file using cat command

​In other cases, you’ll find a ‘configure’ script. This script is a tool to check if your system has all the dependencies required for the building. If you find a ‘configure’ script, you must execute it: ./configure (also, you should check the file permissions).

install .tar.gz program in linux

If the output of the ‘configure’ script doesn’t report any problem, you can continue with the next step.

​To build a package, you must use the program make: make -arguments. More about make here.

Finally I get an executable file:

install executable file in linuxcompile tar.tgz package in linux

​Now I must execute my program. In most cases, you’ll install the program on your computer, so you must use the command ‘make install’. Other tarball packages contain a binary file, for example:

check and install .tar.gz file in linux

Sublime Text is available for Ubuntu, but it doesn’t provide a version for my distro, so I have to use the tarball version (the file type isn’t tgz, it’s a tar.bz2 file).

extract tar file in linux

​It takes the same process, extracts the file.

I found the executable file of sublime text, but I checked the file permissions to execute the file. If your file doesn’t have permissions, you can modify the permissions using chmod

sublime text editor in linux

​Finally execute the program. There are many possibilities when you install .tar.gz package. So you must analyze your situation and install your package. It’s easy, pay attention to your package.

When you use the ./configure command, it will prompt you to install any dependencies. That is all there is to installing .tar.gz or .tgz files in Linux. If you have any problems installing packages using this method please let me know in the comments section below.

Источник

How to Extract tgz or tar.gz Files in Linux

This post will guide you how extract tar.gz or .tgz files using the TAR command under Linux command line. How do I decompress tar.gz file under CentOS or RHEL or Ubuntu Linux operating system from the command line.

The Tar file format is common in Linux or Unix system, but only can be used to store data, and not compressing it. And Tar Files are also can be compressed after being created. And those files become tgz files, using the tgz, tar.gz, or gz extension.

Читайте также:  Sweet home 3d аналоги линукс

extract tgz targz files in linxu1

Tar command options

-t: List the contents of an archive. Arguments are optional. When given, they specify the names of the members to list.
-v: Verbosely list files processed.
-z: Filter the archive through gzip
-j, –bzip2: Filter the archive through bzip2(1).
-J, –xz: Filter the archive through xz(1).

Extracting tgz Files

If you want to extract a tgz file from your Linux command line, you can issue the following tar command, type:

devops@devops:~/tmp$ tar -zxvf mytest.tgz test1 test2 test3 devops@devops:~/tmp$ ls test* test1 test2 test3

Extract tar.gz Files

If you have a tar file that is compressed using a gzip compressor, and you can extract all files from this tar.gz file by issuing the following tar command to decompress it, type:

devops@devops:~/tmp$ tar -zxvf mytest.tar.gz wildfly-17.0.1.Final/ wildfly-17.0.1.Final/bin/ wildfly-17.0.1.Final/bin/client/ wildfly-17.0.1.Final/standalone/ wildfly-17.0.1.Final/standalone/configuration/ wildfly-17.0.1.Final/standalone/lib/ wildfly-17.0.1.Final/standalone/lib/ext/ wildfly-17.0.1.Final/standalone/tmp/ wildfly-17.0.1.Final/standalone/tmp/auth/ wildfly-17.0.1.Final/standalone/deployments/ wildfly-17.0.1.Final/.well-known/ wildfly-17.0.1.Final/.well-known/acme-challenge/ wildfly-17.0.1.Final/appclient/ wildfly-17.0.1.Final/appclient/configuration/ wildfly-17.0.1.Final/docs/ wildfly-17.0.1.Final/docs/licenses/ wildfly-17.0.1.Final/docs/contrib/ wildfly-17.0.1.Final/docs/contrib/scripts/ wildfly-17.0.1.Final/docs/contrib/scripts/init.d/ wildfly-17.0.1.Final/docs/contrib/scripts/systemd/ wildfly-17.0.1.Final/docs/contrib/scripts/service/ wildfly-17.0.1.Final/docs/contrib/scripts/service/amd64/ wildfly-17.0.1.Final/docs/schema/ wildfly-17.0.1.Final/docs/examples/ wildfly-17.0.1.Final/docs/examples/configs/ wildfly-17.0.1.Final/.installation/ wildfly-17.0.1.Final/welcome-content/ wildfly-17.0.1.Final/modules/ wildfly-17.0.1.Final/modules/system/ wildfly-17.0.1.Final/modules/system/layers/ ……

Extracting tar.bz2 files

If you have a tar.bz2 file that is compressed using bZip2 compressor, and you want to extract all files from it. And you can issue the following tar command with the j option. Type:

devops@devops:~/tmp$ tar -jxvf mytest.tar.bz2 test1 test2 test3 devops@devops:~/tmp$ ls test* test1 test2 test3

Extracting tgz/tar.gz/tar.bz2 Files to a Different Directory

By default, the tar command will extract all files into the current directory. And if you want to extract the content of tar/tar.gz/tar.bz2 files into a different directory, and you need to specify a directory in tar command.

For example, you want to extract archive files into another directory called /tmp, you can use the following command:

$ tar -zxvf mytest.tgz -C /tmp $ tar -zxvf mytest.tar.gz /tmp $ tar -jxvf mytest.tar.bz2 /tmp

Extracting a Single File from a Tar File

If you want to extract a single file from a given tgz/tar.gz/tar.bz2 file in your Linux system, you just need to pass the file name pattern of your single file that you want to extract.

For example, you want only to extract a file called test1 . Just issuing the following commands:

$ tar -zxvf mytest.tgz test1 $ tar -zxvf mytest.tar.gz test1 $ tar -jxvf mytest.tar.bz2 test1

List the Content of a Tar File

If you only want to view all files from a tgz/tar.gz/tar.bz2 file in Linux, and you can use the tar command with the -t option. Just run the following command from the command line:

$ tar -ztvf mytest.tgz $ tar -ztvf mytest.tar.gz $ tar -jtvf mytest.tar.bz2 $ tar -Jtvf mytest.tar.xz

Conclusion

You should know that how to extract or decompress a tgz/tar.gz/tar.bz2 file using the tar command in Linux.

Читайте также:  Chmod linux drwxr xr x

Источник

What is TGZ File and How To Extract TGZ In Windows and Linux?

TGZ file is a tar archive which is compressed with the Gzip compression algorithm. Linux operating systems provide tar and gzip by default. A tar archive is created in order to make multiple files and directories single file with a tar archive. And then gzip is used to compress this tar which will create a TGZ file.

Tar.gz

As stated previously TGZ is tar and gzipped file. TGZ can be also expressed as tar.gz . Tar is for tar archive and gz is gzip archive.

TGZ Exract Applications For Windows

There are a lot of tools which can be used to create or extract TGZ file. We will list the most popular application for TGZ below.

List TGZ File Information

We will start by printing the TGZ file information. We will use file command which will print information like file type, last modified time, original size etc.

$ file ls-dyna_example.tgz

List TGZ File Information

Extract TGZ For Linux

Linux distributions like Ubuntu, Debian, Mint, Kali, Fedora, CentOS, RedHat provides requires tools tar and gzip from applications repositories. These tools are installed by default.

$ tar xzvf ls-dyna_example.tgz

Extract TGZ For Linux

Extract For Windows with 7zip

Extracting TGZ files in Windows is very easy. In this case, we will use 7zip` . 7zip is a very popular and useful compression tool which supports different compression algorithms like 7z, rar, zip, tar, gzip etc.

We will right click to the TGZ file and click Extract Here like below.

This will decompress gzip part and create a tar file. We will again Rigth Click and then click to the Extract Here which will decompress the tar file like below.

As we can see the decompressed file will not be deleted automatically.

Источник

Оцените статью
Adblock
detector