From MobileRead
Jump to: navigation, search

Tar is a Unix (Linux) utility to combine a collection of files into one file, called an archive. There are also versions for Windows and of course MacOS X as it is Unix based.

[edit] Introduction

Tar stands for tape archive and was originally intended to provide a backup capability for a tape drive. It does not compress the files but is often used with GZIP to provide compressed content. A tar file usually as a .tar file extension and when combined with gzip it will typically has a .tgz extension also sometimes you will see .tar.gz as a double extension.

tar has been ported to many platforms including Windows systems to provide the ability to extract files from the archive.

[edit] Operation

Tar is generally implemented as a command line utility and can be used in a pipe. It requires a choice of one of three options. (More choices are available in the Gnu version.)

  • -c is the option to create an archive.
  • -x is the option to extract files from an archive.
  • -t is the option to tell (display) the contents of an archive.

Since these are not really options most implementations accept them without the preceding hyphen (-). There are other specialized options depending on what you want to do. Once the options have been entered the next entry on the command line is the tar file name, unless the pipe option is used.

The Gnu version adds the following choices: (again the hyphen is optional)

  • -A append other tar files to this one.
  • -r append other files to this one
  • -d compare (diff) the tar file to the file system
  • -u update only those files that have been changed or added.

[edit] For more information

Personal tools

MobileRead Networks