Compression
gunzip
Decompress gzip-compressed files (equivalent to gzip -d).
Synopsis
syntax
gunzip [OPTION]... [FILE]...
Examples
Decompress a gzipped file
gunzip file.txt.gz
Decompress keeping the .gz file
gunzip -k archive.gz
Recursively decompress directory
gunzip -rv backups/
Common options
| Flag | Description |
|---|---|
| -k | Keep compressed file |
| -v | Verbose output |
| -r | Recurse into directories |
| -f | Force decompression |
About gunzip
The `gunzip` command decompress gzip-compressed files (equivalent to gzip -d). Compression commands reduce file sizes for storage and transfer.
Linux supports multiple compression formats, each with different speed and ratio trade-offs. Understanding these tools is essential for working with archives, backups, log rotation, and software distribution packages.
The command accepts 4 commonly used flags shown above, though the full set of options is available in the man page (`man gunzip`). The 3 examples on this page cover typical real-world usage patterns that you can copy and adapt for your own workflows.
Related commands
More Compression Commands
Other commands in the Compression category