tar
What is a .tar file?
application/x-tar
TAR (Tape Archive) is a Unix archive format that concatenates files with their metadata into a single uncompressed stream of fixed-size blocks. It preserves permissions, ownership, and directory structure but applies no compression itself. It is usually paired with a compressor such as gzip or xz.
How to use a .tar file
Use an example TAR to test archive extraction, metadata and permission preservation, streaming block parsing, and pipelines that combine tar with external compression.
Download example .tar files
- TAR - UncompressedA uncompressed USTAR of a small source tree — for testing tar extraction and the TAR container. Member timestamps are fixed for reproducibility.
- TAR - USTAR FormatThe 1988 POSIX format: 512-byte headers, octal numeric fields, names split across a 155-byte prefix and a 100-byte name, and no mechanism at all for anything that does not fit - including the access and change times its siblings carry. All three archives in this group hold byte-identical members with identical ownership and modification times, so any other difference a reader reports between them comes from the header encoding alone.
- TAR - GNU FormatGNU tar's extension of the same header, identified by its own magic: long names get their own 'L' record, oversized numeric fields switch to base-256, and sparse files get an in-header map. All three archives in this group hold byte-identical members with identical ownership and modification times, so any other difference a reader reports between them comes from the header encoding alone.
- TAR - PAX FormatThe 2001 POSIX format: anything the classic header cannot express moves into an 'x' extended header of UTF-8 key=value records placed immediately before the member it describes. Here each member carries atime and ctime records, which is why this archive is structurally different from its USTAR twin rather than byte-identical to it. All three archives in this group hold byte-identical members with identical ownership and modification times, so any other difference a reader reports between them comes from the header encoding alone.
- TAR - USTAR Prefix-Split PathA 141-character path stored the only way plain USTAR can store one: split at a slash across the header's 155-byte prefix field and its 100-byte name field. Readers that ignore the prefix field report the truncated tail and write the file to the wrong place.
- TAR - GNU Long Name RecordA 125-character path whose long component contains no slash at all, so the USTAR prefix field cannot store it. This archive uses a preceding 'L' (GNUTYPE_LONGNAME) record whose payload is the full path. Its group siblings encode the same class of path with the other two mechanisms.
- TAR - PAX Path HeaderA 125-character path whose long component contains no slash at all, so the USTAR prefix field cannot store it. This archive uses a preceding 'x' extended header carrying a path= record in UTF-8. Its group siblings encode the same class of path with the other two mechanisms.
- TAR - PAX UTF-8 Member NamesPAX is the only tar variant that says what encoding its names are in: extended-header records are UTF-8 by definition. These three members carry accented Spanish and Japanese path components, so a reader that applies a locale-dependent guess instead of trusting the format produces mojibake on exactly this file.
and 15 more in the library.