Skip to main content

Extract file(s) from a gzip (.gz) archive.

# To extract a file from an archive, replacing the original file if it exists:
gunzip <archive.tar.gz>

# To extract a file to a target destination:
gunzip --stdout <archive.tar.gz> > <archive.tar>

# To extract a file and keep the archive file:
gunzip --keep <archive.tar.gz>

# To list the contents of a compressed file:
gunzip --list <file.txt.gz>