The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

Back to UserFriendly Strip Comments Index

Theoretical question about tar/bzip2 by Sharku2007-01-25 08:09:02
  As you mentioned... by ormandj 2007-01-25 10:08:18
... tar is used to create a "collection" of files. It's the equivilant of packing files into a briefcase. Tar was invented/created in order to store multiple files on tape, since tape works best with contiguous files/access. You'd stream a tar off the tape and dump the files out of it onto your disk subsystem. So, in other words, tar performs no compression. There is very very slight overhead for the tar.

Bzip2, of course, compresses the file. If you're going for maximum compression, then bzip2 -9 blah.tar will work best. However, bzip2's disadvantage is the extreme compression time. Most of us that frequently deal with compression/decompression stick with gzip for this reason alone. If you're archiving for long time storage/don't plan to compress/uncompress often, go with bzip2. If you're going to be doing this often, go with gzip.

As to compression ratios, it's going to vary based on the file types as mentioned by a previous poster. Text will compress heavily, pre-compressed source material such as mp3s will not. You can "guess" the compression ratio based on past experience/knowledge of what you are compressing, but you cannot determine an exact compression ratio without actually compressing the data. That's why bzip2/gzip do not have an option to inform you of the compression ratio prior to compressing. :)

It's generally good form to pack multiple files that are associated into a tar, then gzip/bzip2, simply for "good housekeeping" reasons. The very slight overhead of tar is worth the ease. It also makes tape backups less painful - random access is NOT something tapes are well known for (to put it lightly.) :p
[ Reply ]
    psst: using -9 with bzip2 is pointless by Freakazoid2007-01-25 10:11:04
      I like to be explicit by ormandj2007-01-25 10:21:13

 

[Todays Cartoon Discussion] [News Index]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)