gzip

The command that compresses a single file and replaces it with a smaller .gz version; gunzip reverses it.

In more detail

It works on one file at a time, so directories are bundled with tar first. The original file is removed unless you pass -k, and gunzip restores it byte for byte.

Examples

gzip copy.txt
gunzip copy.txt.gz
Kafka producers can compress batches with it: KafkaProducer(compression_type='gzip').

Related terms

Taught in

References

Certification courses