Quote:
You can think of tar kind of like zip on Windows.
|
A small correction: you couldn't think of
tar like
zip for Windows, since Zip is
a compression program (exists for Linux too) whereas tar is
an archiving program. The most visible difference is that
tar does not compress, it just "gathers multiple files inside one file". Zip, on the other hand, "gathers multiple files inside one file and compresses them as you wish".
tar with
gzip,
bzip2 or some other compressing program is something like
zip, but not alone.
tar is often used to keep the permissions of files archived, and if the compression program used can't deal with multiple files (well most of them do I guess but I recall meeting one that didn't?) or there is any other reason to get just one-file archive, for simpleness of moving files (for example), it's good.
tar files just tend to be big if there's a lot of content in the
tar archive, so that's why people use compression with it.
Now that I said that, there is this
cpio program too, which works a bit like
tar, enabling you to copy-in or copy-out data from or to a
cpio archive. One difference is that
tar refuses to archive special files but
cpio doesn't.