What is TAR?
TAR (Tape Archive) is a file format used for collecting multiple files into a single archive file. Originally designed for sequential magnetic tape archives, the format is now commonly used for general file archiving.
TAR is often combined with compression utilities like gzip (.tar.gz or .tgz), bzip2 (.tar.bz2), or xz (.tar.xz) to create compressed archives, making it one of the most versatile archiving solutions in Unix-like systems.
History
The TAR format was created in 1979 at AT&T Bell Laboratories as part of Unix Version 7.
- 1979: TAR created for Unix V7
- 1988: Standardized in POSIX.1-1988
- 2001: GNU tar introduces POSIX.1-2001 format
- Present: Standard for Linux packages and Docker images
Key Features
- File Preservation: Maintains permissions and ownership
- Directory Structure: Preserves folder hierarchy
- No Compression: Designed for combination with gzip/bzip2
- Streaming: On-the-fly archiving capability
- Large Files: Supports files over 8GB
- Cross-Platform: Works on all Unix-like systems
Common Uses
- Software distribution (.tar.gz)
- System backups on Linux/Unix
- Docker container layers
- Package management archives
- Web server file transfers
- Git repository exports
Advantages
- Preserves Unix file attributes
- Simple and transparent format
- Combines well with compression tools
- Industry standard on Unix/Linux
- Open and well-documented
Limitations
- No built-in compression
- Less common on Windows
- No error recovery
- Cannot update files in place
- Limited Windows attribute support
Technical Information
TAR files consist of a series of file entries, each preceded by a 512-byte header containing metadata. The format is simple and sequential, making it ideal for tape backups and streaming.
| File extension | .tar |
| MIME type | application/x-tar |
| Developed by | AT&T Bell Labs |
| First released | 1979 |
| Standard | POSIX.1-1988 |
| Compression | None (combine with gzip/bzip2) |
| Common combos | .tar.gz, .tar.bz2, .tar.xz |