1. Computing & Technology

Discuss in my forum

Example uses of the command "gunzip"

A Brief Introduction

By , About.com Guide

See More About:
The following examples illustrate typical uses of the command gunzip for unpacking an "archive" file.

gunzip archivefile1.txt.gz 
This command uncompresses the file archivefile1.txt.gz and replaces it with the uncompressed version named "archivefile1.txt".

If you want to keep the compressed version, you use the -c option, which writes to standard out, and then re-direct (">") standard out to a file like this:


gunzip -c archivefile1.txt.gz > archivefile1.txt
The ".gz" file extension is commonly used by the compression program gzip, which is the counter part of gunzip.

For all available options of the gunzip command see the man page.

©2012 About.com. All rights reserved.

A part of The New York Times Company.