First of all, you have a misunderstanding. When you execute the tar zcf filename series of commands, you complete the tar merge and then call external compression such as gzip/bzip2
Using tar zcf as an example to illustrate the execution process
The
tar command is only used to merge multiple files into one file, nothing more. Once the merge is completed, tar’s work is over.
Then the merged files are compressed. tar z uses gzip. Others include bzip2/xz/lzma . These are all compression methods, but the compression time and compression ratio are different. If you choose, it is nothing more than finding a balance between time and space.
So tar zcf is a shortcut added by tar. Compression actually relies on external compression tools. If there is a single file, such as when backing up a database, it needs to be compressed. Then there is no point in using tar, because individual files do not need to be merged, only gzip is required.
tar under Linux can indeed add j, z and other parameters to package and add compression function. This is the next rich feature of Linux. In ancient times, tar did not have this function.
Now on aix, the function of tar is much simpler. For example, the bzip2 format is not supported.
First of all, you have a misunderstanding. When you execute the
tar zcf filename
series of commands, you complete the tar merge and then call external compression such as gzip/bzip2Using
tar zcf
as an example to illustrate the execution processThe
tar
command is only used to merge multiple files into one file, nothing more. Once the merge is completed, tar’s work is over.Then the merged files are compressed.
tar z
uses gzip. Others includebzip2/xz/lzma
. These are all compression methods, but the compression time and compression ratio are different. If you choose, it is nothing more than finding a balance between time and space.
So
tar zcf
is a shortcut added by tar. Compression actually relies on external compression tools.If there is a single file, such as when backing up a database, it needs to be compressed. Then there is no point in using tar, because individual files do not need to be merged, only gzip is required.
tar
is packaged.gzip
,bzip2
, etc. are compressed. Strictly follow the Unix principle of do one thing and do it well. Not a thing.tar under Linux can indeed add j, z and other parameters to package and add compression function.
This is the next rich feature of Linux.
In ancient times, tar did not have this function.
Now on aix, the function of tar is much simpler. For example, the bzip2 format is not supported.
Come and see and learn
Compressed into zip format to facilitate data processing by other operating systems.