How to Gzip File Compression in Unix
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
-
-
1
Type ls -l in a Unix shell at the command prompt to identify the file or files you wish to compress
-
2
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.
-
-
3
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.
-
4
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.
-
5
Type "zcat filename > newfile" to place a compressed file into a new file.
-
1
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.