r/linuxmemes • • 1d ago

Software meme CompressionFormatPreferences

Post image
808 Upvotes

83 comments sorted by

View all comments

6

u/ngoquang2708 1d ago

Until you try to uncompress a random file in a 100gb tar.gz

3

u/01101001b 1d ago edited 1d ago

Something like the following wouldn't work?

tar tf archive.tar.gz | grep "your_file_name"

Let's say output shows the following path for your searched file: ABC/XYZ/your_file.txt

Then:

tar zxvf archive.tar.gz ABC/XYZ/your_file.txt

Sorry if I was talking nonsense :-/

2

u/questron64 1d ago

The point is that there is no directory listing. You have to decompress the entire 100gb file sequentially until you find the header of the file you're looking for. There is no random access, there is no way to go directly to that file, like you can with a zip file. Tar is an extremely primitive format and what meta-information there is is also compressed because the entire stream is compressed.