Linux Commands Helper
💬 Your AI-powered Linux assistant
gzip Command - Compress or Decompress Files
The gzip command is used to compress or decompress files using the GNU zip compression algorithm. It is commonly used to reduce file size for storage or transfer on Linux systems.
Syntax
gzip [options] file
Examples
gzip file.txt
Compress file.txt
to file.txt.gz
.
gzip -d file.txt.gz
Decompress file.txt.gz
to file.txt
(same as gunzip
).
gzip -k file.txt
Compress file.txt
but keep the original file.
Notes
- gzip only compresses single files; use
tar
for directories. - Decompression can be done with
gzip -d
orgunzip
. - gzip is widely supported and used in Unix-like systems.