# 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.

Author: [Flavio Copes](https://flaviocopes.com/about/) | Published: 2020-10-10 | Topics: [CLI](https://flaviocopes.com/tags/cli/) | Canonical: https://flaviocopes.com/linux-command-gunzip/

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:

```bash
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:

```bash
gunzip -c filename.gz > anotherfilename
```

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