S
S
Sergey Pugovkin2020-08-12 20:02:49
linux
Sergey Pugovkin, 2020-08-12 20:02:49

How much space does the gzip command need?

That is, first a copy of all compressed files (tar) is created into one file, then this file is compressed (gzip). In total, when compressing a folder weighing 1Gb, there should be 1Gb free for tar and up to 1Gb for gzip.
In total, to compress 1Gb, it may take up to 2Gb. So?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
Saboteur, 2020-08-12
@Driver86

no
gzip is a stream archiver, it doesn't work with files, it works with streams.
tar itself cannot compress, the option says that you need to transfer the output stream not to a file, but to gzip (you can make sure that by removing gzip from the system, the option in tar will stop working)
Therefore, the output of tar is redirected to gzip, which compresses on the go, and already writes to a .tgz file. No intermediate file is created.
PS The compression ratio of gzip is much lower than any other archiver that has the ability to analyze the entire file, but it is its architectural advantage that allows the tar + gzip bundle to stay afloat for so many years.

S
Sergey Josephf, 2020-08-12
@DjozefonGang

Hello Sergey!
Read this documentation: https://linux-faq.ru/page/komanda-gzip , maybe you will find something for yourself.

V
vreitech, 2020-08-12
@fzfx

gzip does not create tar, tar itself does.
The gzip command needs as much space as the compressed file will take up. if your 1 GB is compressed badly, then about 1 GB of space may be required, if it is good, less.

V
Vitaly Karasik, 2020-08-12
@vitaly_il1

I don't think.
IMHO this happens in memory and the double space is unnecessary.
At least with "tar cz ...."

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question