Archiving ≠ Compressing
Two Different Jobs
Scenario: You need to email 2,000 log files to a colleague, and they add up to 800MB. You'll do two things: bundle them into one file, and shrink it. Those are separate operations, and mixing them up is a classic beginner confusion.
| Operation | Tool | Result |
|---|---|---|
| Archive (bundle many → one) | tar | A .tar file (a "tarball"), same total size |
| Compress (shrink) | gzip, bzip2, xz, zip | A smaller file |
Analogy: Archiving is putting all your clothes into one suitcase. Compression is vacuum-sealing that suitcase so it takes less space.tarpacks the suitcase;gzipvacuum-seals it. Usually you do both - which is why you see.tar.gz.
So a file called backup.tar.gz was tarred (bundled) and then gzipped (compressed). You'll create these constantly for backups, deployments and transfers.