How to Decompress a Tar

If you want to deliver a batch of files from a Linux system, you usually use the Tar command. When you "tar" a directory, you can easily roll up a group of files. When you receive one of these files, you need to understand the process to decompress a .tar file, often called a "tarball." This guide will walk you through the necessary steps.

Things You'll Need

  • Linux PC
Show More

Instructions

    • 1

      Open up a terminal session on your Linux PC. This can be done by clicking on the Home button or the Terminal icon on the bottom bar, then looking for "Xterm."

    • 2

      Once in the terminal, type "tar -xf"; do not press "Enter." The "x" indicates that you are extracting the contents of a tar file, and the "f" tells it to use the filename you specify.

    • 3

      Press the space bar once and type in the full name (with extension) that you want for the file. Make sure you are in the same directory as the file in question.

    • 4

      Press the space bar once again and enter the path of the directory. Remember that the path should be relative to the location you're issuing the command from. For example, if the full path of the directory is "hdd0\home\user\pictures" and you issued the command from the User directory, then you'd simply have to put "pictures\" in this area.

    • 5

      Press "Enter." Once the process is completed, you should be able to see the tarball's directory structure in the location you specified.

Tips & Warnings

  • If you do not enter a directory at the end of the command, the tar will be uncompressed in the current directory.

  • A detailed explanation of all of the "tar" parameters can be obtained any time by typing "tar -help".

  • As well as being tarballed, files with a ".tar.gz" extension are also compressed. In this instance, you'll also have to change "-xf" to "-xzf".

  • Ensure that no existing files will accidentally get overwritten. The easiest way to avoid this is to decompress the tar to an empty directory.

Related Searches:

Comments

You May Also Like

Related Ads

Featured