Skip to content

Linux commands: gunzip

A quick guide to the `gunzip` command, used to unzip gzipped files

The gunzip command is basically equivalent to the gzip command, except the -d option is always enabled by default.

The command can be invoked in this way:

gunzip filename.gz

This will gunzip and will remove the .gz extension, putting the result in the filename file. If that file exists, it will overwrite that.

You can extract to a different filename using output redirection using the -c option:

gunzip -c filename.gz > anotherfilename

The gunzip command works on Linux, macOS, WSL, and anywhere you have a UNIX environment


→ Here's my latest YouTube video

→ Get my Linux Command Line Handbook

→ I wrote 17 books to help you become a better developer, download them all at $0 cost by joining my newsletter

JOIN MY CODING BOOTCAMP, an amazing cohort course that will be a huge step up in your coding career - covering React, Next.js - next edition February 2025

Bootcamp 2025

Join the waiting list