Answer the question
In order to leave comments, you need to log in
Archiving and compression in Linux?
Why do you need to archive files at all?
I used to think that you need to archive with tar in order to collect all the files into one file, and it’s already convenient to compress them later.
But you can immediately compress many files at once with one command, without archiving.
Enlighten plz
Answer the question
In order to leave comments, you need to log in
tar was originally made for packing files and directories into a tape archive (in a single stream).
gzip is a stream archiver, it doesn't know about files, it packs a stream. On the run. Fast. It does not parse the entire file, so the algorithm that is used in gzip is now used almost everywhere (in modems, network cards, and so on).
historically, tar+gzip was used to compress multiple files, which has become the de facto standard.
In today's world, a standard is more important than a few percent compression, so .tgz is a very popular and reliable solution that will work on any Linux. But zip is not everywhere. You apparently have not come across cut-down versions of Linux in embedded, and even in RHEL7 it is not included in the standard delivery, you must install it separately.
And finally - tar can store posix permissions, but zip or rar cannot. Therefore, the .tgz format will remain with us for a long time.
compression without archiving is less efficient, although easier to access.
for a cold backup or batching of data, it is more convenient to keep everything in one set.
it's a pity that tar and cpio don't have a file index.
you need to dig into rar5, it seems * nix file attributes were brought there.
What is the problem with one command to archive in tar, and then in gzip or bzip2?
For example.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question