How to Gzip File Compression in Unix

By eHow Computers Editor

Rate: (2 Ratings)

Gzip is a Unix utility program to compress files. Files compressed using Gzip are replaced by a smaller file with the same name and a suffix indicating it is a Gzip file. Gzip possess a number of functional options. For example, instead of compressing to a new file, the output of Gzip may be directed to STDOUT to feed a Unix command pipe.

Instructions

Difficulty: Moderate

Step1
Type ls –l in a Unix shell at the command prompt to identify the file or files you wish to compress
Step2
Enter “gzip” and then a filename. The filename may include characters expanded by a shell such as ? or *. All selected files will be compressed individually.
Step3
Key in ls –l to see the result. Compare the zipped file size to the original file and you will see the effect of Gzip.
Step4
Use the –d option to uncompress Gzip files. To expand the file to its original size and filename use the command “gzip –d” followed by the filename.
Step5
Type “zcat filename > newfile” to place a compressed file into a new file.

Tips & Warnings

  • Use the –r option to compress all files in the working directory and its child directories.
  • Gzip provide the option to run faster with less compression or slower with greater compression in ten steps.
  • Gzip is a Unix tool. Files zipped using Gzip cannot be unzipped in windows system by using popular tools like Winzip.

Post a Comment

POST A COMMENT

Request a New How-To Article

Looking for more How To information? Chances are there’s an eHow member who knows how to do what you’re looking to do. Submit an article request now!

eHow Article:  How to Gzip File Compression in Unix

eHow Computers Editor

eHow Computers Editor

Category: Computers

Articles: See my other articles

Related Ads