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

Steps

  1. 1
    Open the terminal.
  2. 2
    Type tar.
    Advertisement
  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.
  10. Advertisement

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.
Advertisement

Warnings

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

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 348,596 times.
How helpful is this?
Co-authors: 11
Updated: July 8, 2019
Views: 348,596
Categories: Linux
Advertisement