LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

gunzip

decompresses files compressed by gzip, zip, compress, or pack

TLDR

Decompress a file
$ gunzip [file.gz]
copy
Decompress keeping original file
$ gunzip -k [file.gz]
copy
Decompress to stdout
$ gunzip -c [file.gz]
copy
Decompress multiple files
$ gunzip [file1.gz] [file2.gz]
copy
Test compressed file integrity
$ gunzip -t [file.gz]
copy
List compression information
$ gunzip -l [file.gz]
copy
Force decompression (ignore warnings)
$ gunzip -f [file.gz]
copy
Verbose output showing compression ratio
$ gunzip -v [file.gz]
copy
Decompress a file with a custom suffix
$ gunzip -S [.zz] [file.zz]
copy
Recursively decompress files in a directory
$ gunzip -r [directory/]
copy

SYNOPSIS

gunzip [options] [files...]

DESCRIPTION

gunzip decompresses files compressed by gzip, zip, compress, or pack. It is equivalent to `gzip -d`. For each compressed file, gunzip creates the uncompressed version and removes the .gz extension.The tool automatically detects the compression format and handles .gz, .z, .Z, and .tgz extensions. Files created by gzip can be recovered even if corrupted, with gunzip replacing damaged blocks with zeros.gunzip preserves the original file's name, timestamp, and permissions stored in the compressed file header.

PARAMETERS

-c, --stdout

Write to stdout, keep original files.
-f, --force
Force decompression even with warnings.
-k, --keep
Keep compressed files.
-l, --list
List compression ratio.
-n, --no-name
Don't restore original name/timestamp.
-N, --name
Restore original name/timestamp (default).
-q, --quiet
Suppress warnings.
-r, --recursive
Recurse into directories.
-t, --test
Test integrity.
-S suffix, --suffix suffix
Use the given suffix instead of .gz.
-v, --verbose
Verbose output showing name and compression ratio.
-1 to -9
Ignored by gunzip; accepted for compatibility with gzip.

INSTALL

sudo apt install gzip
copy
sudo dnf install gzip
copy
sudo pacman -S gzip
copy
sudo apk add gzip
copy
sudo zypper install gzip
copy
brew install gzip
copy
nix profile install nixpkgs#gzip
copy

CAVEATS

Original compressed file is removed by default. Cannot decompress to a different filename directly (use -c and redirection). May fail silently on corrupted files without -v flag.

HISTORY

gunzip is part of the gzip package, created by Jean-loup Gailly and Mark Adler in 1992. It was designed as a free decompressor for gzip files and also handles other compression formats for compatibility. The tool became standard on Unix systems as part of the transition from the patent-encumbered compress utility.

SEE ALSO

gzip(1), zcat(1), compress(1), bunzip2(1), unxz(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid