What does tar do, and why is bundling separate from compressing?
tar ("tape archive") packs many files and directories into a single archive file, preserving their metadata — but on its own it does not compress; compression is a separate step.
tar glues a whole directory tree into one stream: file contents plus an index of names, sizes, permissions, ownership, and timestamps. That single-file result is easy to move around or hand to a backup, and because the metadata travels with it, an extracted tree is bit-for-bit the original (same permissions, same owners).
The thing to internalize: archiving and compression are two jobs.
- Archiving = many files → one file (what plain
tardoes). - Compression = make that file smaller (what gzip/bzip2/xz do).
A bare .tar is therefore the same total size as its contents — it just has fewer files. You combine the two jobs (tar -czf) to get the familiar .tar.gz.
tar -cf archive.tar /path/to/files # create: bundle, no compression
tar -tf archive.tar # list contents (test/table)
tar -xf archive.tar # extract
Heritage: the name comes from backing up to tape, which is sequential — hence an archive is a stream with an index, letting you pull out one file without reading the whole tape. That index is why individual extraction works.
Go deeper:
GNU tar manual — archiving vs compression and the tape heritage.
tar(1) man page — concise command reference.