tar compresses compressed files
by M0M0 from LinuxQuestions.org on (#5DTT3)
Today I decided to archive some old directories. These directories contained huge compressed *.tar.gz files. Now I run:
tar czvf archive.tar.gz directory_that_contains_large_compressed_tar.gz_files
I saw that the algorithm stops at the compressed files and take quite some time to compress them again. I find that very surprising since those files are already compressed with the very same algorithm. What I would assume that already compressed files do not need to be compressed again and are just added to the tarball. So can someone explain how tar actually works and why it compresses compressed files again?


tar czvf archive.tar.gz directory_that_contains_large_compressed_tar.gz_files
I saw that the algorithm stops at the compressed files and take quite some time to compress them again. I find that very surprising since those files are already compressed with the very same algorithm. What I would assume that already compressed files do not need to be compressed again and are just added to the tarball. So can someone explain how tar actually works and why it compresses compressed files again?