Archives and disk tools

Linux commands: gunzip

Learn how the Linux gunzip command decompresses gzipped .gz files, removing the extension, or extracts to a new filename using gunzip -c with redirection.

8 minute lesson

~~~

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

Lesson completed

Take this course offline

Get every free book and course as PDF and EPUB files.

Get the download library →