Beginner Package: gzip

gunzip

Decompress a .gz file.

Syntax

gunzip file.gz

Description

gunzip reverses gzip, restoring a .gz file to its original form. It is equivalent to running gzip -d, and many people simply use that instead.

Examples

gunzip file.txt.gz
Decompress a .gz file, restoring the original
gzip -d file.txt.gz
Equivalent alternative using gzip's own decompress flag
zcat file.txt.gz
View a .gz file's contents without decompressing it to disk

Applies to

Ubuntu Debian Linux Mint RHEL CentOS / Rocky / AlmaLinux Fedora Arch Linux openSUSE Alpine Linux