this post was submitted on 28 Nov 2025
24 points (96.2% liked)

Linux Questions

2896 readers
21 users here now

Linux questions Rules (in addition of the Lemmy.zip rules)

Tips for giving and receiving help

Any rule violations will result in disciplinary actions

founded 2 years ago
MODERATORS
 

A .tar archive is basically only the files cat'ed together, with a header and index added, right?

And a .tar.gz takes forever to modify, because it needs to first extract the .tar.

So why is there no archive format that just cat'es the compressed files together?

you are viewing a single comment's thread
view the rest of the comments
[–] moonpiedumplings@programming.dev 9 points 23 hours ago

This is what zip does. It compresses files individually, and then combines them into the archive. This comes with the advantage that you don't have to extract the whole archive to view and edit files, but it comes with a very big disadvantage, which is that there is no compression across files. Redundant data in each file is not deduplicated.

Tar.gz does compress across files, which saves more space. That is to say, the reason why we don't just tar gzed files together, is because people decided that compression savings matter more than not having to extract the whole archive to view/edit files.

7z is the best of both worlds, as it compresses across files, but also lets you view and edit files without extracting the whole archive. But it's important to remember that tar.gz is ubiquitous for it's compatibility, rather than it's performance or features. Even the most smallest, stripped down utilities, or the most oldest, out of date systems, always have gz and tar, whereas even on modern desktop distros 7z may need to be explicitly installed.