OmniSecu.com Logo  
omnisecu.com free mcse ccna rhce linux java learning
omnisecu.com free mcse ccna rhce linux java learning
          Sharefacebook twitter google+ google bookmark yahoo bookmark delicious digg linkedin pinterest reddit stumbleupon evernote diigo blinklist blogmarks livejournal email feed

Tutorials

How to compress, uncompress and view files using Linux commands gzip, gunzip and zcat

External Resources

Compressed files occupy less disk space and download faster than large, uncompressed files. You can compress Linux files with the open-source compression tool gzip and decompress the compressed files using gzip or gunzip tool. The Linux gzip tool reduces the size of the files using Lempel-Ziv coding (LZ77).

gzip/gunzip/zcat

You can compress a file using gzip by the following commands. The first command will create a compressed gzip file with gz extension, removing the uncompressed file and second command will create a compressed gzip file with gz extension keeping the uncompressed file. The Linux zcat command allows the user to expand and view a compressed file without uncompressing that file.

[root@RHEL2 gzip]# gzip gzip.txt

Or

[root@RHEL2 gzip]# gzip -c gzip.txt > gzip.txt.gz

And decompress the compressed file using the following command

[root@RHEL2 gzip]# gzip -d gzip.txt.gz

A compressed file can also decompressed by using gunzip command as shown below.

[root@RHEL2 gzip]# gunzip gzip.txt.gz

To list the compressed file information, use “gzip –l” option.

[root@RHEL2 gzip]# gzip -l gzip.txt.gz

To view a compressed file, without uncompressing it, you can use the zcat file as shown below.

[root@localhost ~]# zcat gzip.txt.gz
This is a test...
1
2
3
4
5
6
7
8
9
10

              Jajish Thomason Google+
Related Topics
How to compress, uncompress and view files using Linux commands gzip, gunzip and zcat How to use Linux tar (tape archive) command to create archives Introduction to RedHat Package Manager (RPM) Introduction to YUM (Yellow dog Updater, Modified) Package Manager
comments powered by Disqus


eXTReMe Tracker DMCA.com