CentOS Linux Server Guide

File compress using gzip in CentOS Linux

Gzip

  • Gzip, is the most common command used for file compression in Linux

  • File compressed under gzip, will have .gz extension.

Command name

gzip

 

Synopsis

gzip [option] filename > compressed_file_name.gz

 

Option

-v  show compression rate

-l   show info of .gz file

-r   compress recursively of given file and all the subfolders

-c  redirect the file compression output into a gz file extension

 

Note

Upon gzip usefully complete file compression, the original document/file will be removed. Thus, it is always recommend to use option -c  together and file redirection >

 

The following gzip format is wrong
gzip -vlc wtmp

gzip: wtmp: not in gzip format

 

Example
gzip -v -c scrollkeeper.log> scrollkeeper.gz
scrollkeeper.log: 94.5%
 

 

Back to Home



Copyright 2011 http://www.1a-centosserver.com All Rights Reserved

All trademarks are the property of their respective owners.

Contact Us | Terms of Use | Privacy Policy