Introduction to reading TAR archives

TAR stands for Tape ARchive and is a format for storing multiple files and directories in a single file. This was originally used for storing data on tape, in tape archive files.

tar file has .tar extension

To reduce size, it can be compressed, often with the "gzip" program, and it will then have the extension .tar.gz or .tgz

Here are some basic operations for reading Tape ARchive files.

For example:

tar tvzf /home/backup/htdocs_thisweek.tgz |more
cd /
tar xvzf /home/backup/htdocs_thisweek.tgz

t means list the Table of Contents for the TAR (but don't actually extract the files)

v means, be verbose - show details for each file, such as size and ownership

f means you will specify the name of Tape ARchive file, and the name follows

z means handle files compressed with gzip (decompress them)

x means extract the files inside the TAR. If you don't specify a particular file, all files will be extracted. (To the current directory.)

Up to: Aleksey's tech notes