How to unpack tar.gz in linux

Anonim

How to unpack tar.gz in linux

The standard file system data type in Linux is considered tar.gz - the usual archive compressed using the GZIP utility. In such directories, various programs and lists of folders, objects are often distributed, which allows you to make a convenient movement between devices. This type of files is also unpacked, it is also quite simple, for this you need to use the standard built-in utility "Terminal". This will be discussed in our current article.

Unpack the TAR.GZ format archives in Linux

In the very procedure of unpacking, there is nothing complicated, the user will only need to learn one team and several arguments associated with it. Installation of additional tools is not required. The process of performing the task in all distributions is the same, we took for the example of the latest version of Ubuntu and we suggest you step by step to deal with the question of interest.

  1. To begin, it is necessary to determine the location of the desired archive in order to continue to go to the parent folder through the console and already there to carry out all other actions. Therefore, open the file manager, find the archive, right-click on it and select "Properties".
  2. Go to archive properties via file manager in Linux

  3. A window will open in which you can get detailed information about the archive. Here in the "Main" section, pay attention to the "Parent Folder". Remember the current path and boldly close the "properties".
  4. Find out the parent archive folder in Linux

  5. Launch the "terminal" by any convenient method, for example, by holding the Ctrl + Alt + T hot key or using the corresponding icon in the menu.
  6. Run the terminal to unpack the archive in Linux

  7. After opening the console, immediately go to the parent folder by entering the CD / Home / User / Folder command, where the user is the user name, and Folder is the name of the directory. It should also be known that the CD command is just responsible for moving to a certain place. Remember this to further simplify the interaction with the Linux command line.
  8. Go to the location of the archive in the Linux operating system

  9. If you want to view the contents of the archive, you will need to enter the TAR -ZTVF Archive.tar.gz string, where Archive.tar.gz is the name of the archive. .tar.gz add to this. When the input is completed, click on ENTER.
  10. A command to view the contents of the archive through the console in Linux (1)

  11. Expect output to the screen all directories found and objects, and then using the mouse scroll, you can get acquainted with all information.
  12. Display all archive files in the Linux console

  13. Unpacking starts in the place where you are, by specifying the TAR -XVZF Archive.tar.gz command.
  14. A command to unpack the archive through the console in Linux

  15. The duration of the procedure sometimes occupies a sufficiently large amount of time, which depends on the number of files within the archive itself and their volume. Therefore, wait for the appearance of a new input row and until this point, do not close the "Terminal".
  16. Procedure for unpacking the archive through the console in Linux

  17. Later, open the file manager and find the created directory, it will have the same name with the archive. Now you can copy it, view, move and produce any other actions.
  18. Go to the created folder after unpacking the archive in Linux

  19. However, it is not always necessary to pull out all files from the archive, because of which it is important to mention that the utility under consideration supports unzipping and one particular object. To do this, use the TAR -XZVF Archive.tar.gz file.txt command, where File.txt is the file name and its format.
  20. Unpack a specific file through the console in Linux

  21. Consider the name register, carefully follow all letters and symbols. If at least one error is allowed, the file will not be able to find and you will receive an error notification.
  22. Compliance with the register when unpacking files in Linux

  23. It concerns such a process and separate directory. They are pulled out using tar -xzvf archive.tar.gz DB, where DB is the exact name of the folder.
  24. Unpack the folder from the archive through the console in Linux

  25. If you want to pull the folder from the directory, which is stored in the archive, the command used is as follows: tar -xzvf archive.tar.gz db / folder, where DB / Folder is the desired path and the specified folder.
  26. Unpack the archive subfolder through the console in Linux

  27. After entering all the commands you can see the list of the contents received, it is always displayed with separate lines in the console.
  28. View unpacked content from archive in Linux

As you might notice, when you enter each standard TAR command, we used several arguments simultaneously. You need to know the meaning of each of them if only because it will help better understand the unpacking algorithm into the sequence of the utility. Remember the arguments will be required:

  • -x - extract files from the archive;
  • -f - specifying the name of the archive;
  • -z - carrying out the execution of unzipping through the GZIP (must be entered, since TAR formats there are several, for example, tar.bz or just tar (archive without compression));
  • -V - Displays the list of processed files on the screen;
  • -t - display of content.

Today, our attention was focused specifically on the unpacking of the considered file type. We showed how to view the contents, pull out one object or directory. If you are interested in the procedure for installing programs stored in tar.gz, our other article will help you, which you will be found by clicking on the following link.

See also: Installing TAR.GZ format files in Ubuntu

Read more