Tar (computing)

Template: Infobox file format / Maintenance / Magic number is missing template: Infobox file format / Maintenance / Developers missing template: Infobox file format / Maintenance / default missing template: Infobox file format / Maintenance / missing site

Template: Infobox file format / Maintenance / Screenshot Format Screenshot of the help display of GNU tar

Tar is a very common in the Unix environment Pack program. In addition, the file format as is known, is used by this program.

The name was formed from tape archiver ( tape archiver ), since the program originally data was backed up to tape drives. At the same time the English word for tar tar ( with the program files will be uncompressed to a file " glued together ").

Tar provides the ability to write files sequentially in a single file or restore files from Selbiger. The resulting file has the extension. Tar and is referred to in English as a tarball ( tar balls or Teerkugel dt ).

The MIME type for tar files is application / x - tar.

Compression

The random access to individual files in tar is not possible because the archive files do not have a directory that holds up the file offsets for quick access, as is the case for example in Zip ( this does not mean that it is not individual files from an archive can be unpacked ). The absence of this additional structure allows also to easily enlarge archives and especially how to extract files from an incomplete or defective archives.

Today, tar archives are commonly found in tar files than on tape. These archive files are usually compressed to reduce their size. These usually come Unix typical compression tools such as compress, gzip, bzip2, xz or lzma used. The approach, first concatenate all files uncompressed in order to compress then is referred to as solid compression and now also used in other archive formats such as RAR or 7 -Zip. Depending on the compression program used the file extensions are generally kept a tarball. Tar.Z (compress ). Tar.gz or tgz shortly. (Gzip ). Tar.bz2 or. Tbz2 or. Tbz ( bzip2 ) or. Tar.xz or. TXZ ( xz ), or tar.lzma ( lzma ).

If no solid compression is desired, the individual files can be compressed first and then incorporated into the tarball. Thus, it is still possible to extract incomplete items of a tar archive, if an algorithm has been chosen for solid compression, has not mastered a restart after a broken block. The drawbacks (limited file size by the necessary temporary space for the compression of individual files or complete failure in itself during archiving changing files ) outweigh however, so this approach is not usually chosen: Because you need to know when unpacking if and way in which the individual files have been compressed as it is not apparent from the file extension; the archive is unpacked but normal, Tar reports no error, but extracting all files to continue compressed form. In addition, the compression rate is usually lower than for solid compression. In addition, only a small speed advantage when extracting individual files results because the archive for this must be searched sequentially anyway.

Problems, alternatives

The tar format was released in 1979 in an update for UNIX Version 7, ustar and pax are in the POSIX standard specifies. The common Linux GNU tar does not match the POSIX standard. In particular, the frequent lack of ability to store access control lists make, tar and GNU tar for some users to only limited useful data backup programs. The insufficient in some implementations support sparse files can also result when transferred back to an archive problems. star or bsdtar try to avoid these disadvantages.

Another disadvantage lies in the systemic way of compression. Solid compression due namely, that the loss of a single block may result in the loss of the entire remaining tape library result, if the compression program after this point can not sync. In this area there has been attempts such as afio, the compressed file by file, but touches on a private version of what has become a declared by POSIX deprecated cpio format, and certain blocks compressing algorithms, which already counts up to a certain degree bzip2.

A Unix command that tar is very similar in its functions is cpio. The POSIX standard pax pretends to unite the tar and cpio commands and is a result of so-called Tar Wars that took place around the year 1992. The most popular program for archiving files on Unix is independent of this standardization continue to tar.

Some sample calls

Archive with content of / etc and / home create:

Tar cvf testarchive.tar / etc / / home / tar cvf - / etc / home | gzip > testarchive.tar.gz tar czvf testarchive.tar.gz / etc / / home / # * GNU tar * short form tar czvf testarchive.tar.gz / etc / / home / # * GNU tar * Alternative Archive unpack:

Tar xvf testarchive.tar gunzip < testarchive.tar.gz | tar xvf - tar xzvf testarchive.tar.gz # * GNU tar * short form tar-xzvf testarchive.tar.gz # * GNU tar * Alternative Unpack no- anchored singlefile.txt # single file - tar - xzvf testarchive.tar.gz View archive content:

Tar tvf testarchive.tar gunzip < testarchive.tar.gz | tar tf - tar tzvf testarchive.tar.gz # * GNU tar * short form tar tzvf testarchive.tar.gz # * GNU tar * Alternative The syntax of the commands without leading minus is compatible UNIX syntax and should be preferably used.

Tar and Windows

With the Windows operating system, the packed with tar files can not be directly unpacked or opened. For this an additional program is required. The following references will help in search of this additional program continued: 7 -Zip, IZArc or TUGZip. But other popular archive programs can open tar archives, at least.

761842
de