Session and utilities
The gunzip command
Decompresses .gz files and recovers the original.
Syntax
gunzip [-k] archivo.gzMost useful options
-kKeeps the .gz-cWrites the result to screen-lLists info about the compressed fileCopy-ready examples
$ printf 'texto\n' > f.txt && gzip -k f.txt && gunzip -k f.txt.gz && lsDecompressYou can try them in the browser terminal: it does not touch your computer.
Typical mistakes
- gunzip only understands .gz; for .bz2 or .xz use their own tools.
FAQ
Can I recover a file deleted by gzip?
No: if gzip deleted the original without -k, only the .gz remains, which must be decompressed.
Learn to actually use it
The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.
Start the free course