Extract files from TAR archives with and without compression (GZip).

Steps

  1. 1
    Open the terminal.
  2. 2
    Type tar.
  3. 3
    Type a space.
  4. 4
    Type -x.
  5. 5
    If the tar file is also compressed with gzip (.tar.gz or .tgz extension), type z.
  6. 6
    Type f.
  7. 7
    Type a space.
  8. 8
    Type the name of the file that you wish to extract.
  9. 9
    Press enter.

Community Q&A

  • Question
    When I try to extract the Tar file I get the message, "No such file or directory." What does this mean?
    Community Answer
    Community Answer
    You're probably referencing the file incorrectly. Check the location that the terminal is open in, and the relevancy of the file's location to it.
  • Question
    What if the file is on a USB drive?
    Living Concrete
    Living Concrete
    Top Answerer
    You will need to change the terminal's working directory to the USB drive.
  • Question
    What if the file is in my Home directory?
    Living Concrete
    Living Concrete
    Top Answerer
    It does not matter where the file is located. As long as you change your terminal's working directory to the directory that contains the TAR file, the extraction will work just fine.
  • Question
    Once I extract the files, how do I launch the program?
    Pingu
    Pingu
    Top Answerer
    This depends on the program. It's best to look for instructions on the website you got it from. Or try a common method of how to run programs: First, go into the directory you just created by extracting. Look for a file with the name of the program. If you find one, type "./fileName" (no quotation marks, replace fileName with the actual file name). If it says "permission denied", type "chmod +x fileName" and try again. If you find no such file, try looking in the "bin" directory (which is inside the extracted directory).

Warnings

  • Extracting an archive may overwrite files in some locations if the archive has a file of the same name.

About This Article

wikiHow is a “wiki,” similar to Wikipedia, which means that many of our articles are co-written by multiple authors. To create this article, 11 people, some anonymous, worked to edit and improve it over time. This article has been viewed 340,495 times.
How helpful is this?
Co-authors: 11
Updated: July 8, 2019
Views: 340,495
Categories: Linux