How to Extract Tar Files in Terminal
Files with the ".tar" extension, sometimes called "tarballs," are a type of compressed archive, which means they contain several different files that have been compressed into one big file. Tar files are the most common format through which open-source software is distributed and are often used in UNIX-based operating systems such as Linux. While programs capable of extracting tar files exist, the most simple and common method of extraction is through the terminal.
Instructions
-
Uncompressing Tar Files
-
1
Open the terminal and locate the directory in which your .tar file is stored.
-
2
Change to this directory in terminal using the cd command. To do this, simply type the characters "cd" into the terminal, followed by one blank space and then the directory. For example, "cd home/users/bin" will take the terminal to the /bin folder.
-
-
3
Once in the same directory as the .tar file, type the command "tar -zxvf filename.tar." Press "enter." This will decompress the .tar file into the original separate files.
-
1
Tips & Warnings
.tar files come in different subtypes such as .tar.gz and tar.z. All subtypes can be uncompressed using the terminal commands above; however, you must enter the correct file extension or terminal will be unable to find the file. To extract the .tar file into a directory other than the one it is stored in, add the command "-C /directoryname" between the "tar" and "-zxvf" terms of the command.
Always make sure your .tar file comes from a trusted source, as this format has been exploited by hackers in the past.