• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Techgoeasy

Techgoeasy

Learn Oracle, PHP, HTML,CSS,Perl,UNIX shell scripts

  • Home
  • Oracle
    • Oracle database
    • Oracle Ebusiness Suite
    • Oracle weblogic
    • Oracle Performance Tuning
    • Oracle Hyperion
    • Oracle Cloud Tutorials
  • SQL
  • interview questions
  • Linux
  • PHP and HTML
  • Downloads
  • General
Home » Unix command and scripts » gzip and gunzip command in Linux

gzip and gunzip command in Linux

June 29, 2020 by techgoeasy Leave a Comment

In continuation of our series of Linux tutorial,I am here presenting the gzip and gunzip command in Linux

gzip and gunzip command

gzip : The gzip utility will attempt to reduce the size of the named files. File will be replaced by one with the extension .gz, while keeping the same ownership modes, change times and modification times.

gunzip: The gunzip utility will restore files to their original state after they have been compressed using the gzip utility.

$ls
alert_CHECK.log 
$gzip alert_CHECK.log
$ ls
alert_CHECK.log.gz  

$ls
alert_CHECK.log.gz
$gunzip alert_CHECK.log.gz
$ ls
alert_CHECK.log 

The gzip command can be used with tar command also to gzip the tar files. Example is show below

tar gzip command

tar -cvf - file1 file2 | gzip > file.tar.gz
tar gzip command linux

Similary gunzip command can be used with tar command also to unzip the tar files. Example is show below

tar guzip command

gunzip -c file.tar.gz|tar -xvf -
tar gunzip command

Difference between gzip and compress

Both the utlity compress and gzip compress the file i.e serve the same purpose

(1) In general Compress will run faster and use less memory, but gzip will generally reach significantly higher levels of compression.
(2) Compress is a old algorithm while gzip is the new one

Also Read
Linux command for Oracle DBA
sed command in unix examples
basic unix command
loop in shell scripts
awk command in Unix
tr command in Unix
https://en.wikipedia.org/wiki/Bzip2

Filed Under: Unix command and scripts

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar



Subscribe to our mailing list

Enter your email address to subscribe to this blog and receive notifications of new posts by email

Recent Posts

  • srvctl commands
  • how to check db size in oracle
  • How to access oracle cloud compute instance(Linux/Window)
  • size of schema in oracle
  • Pagination in Oracle

Copyright © 2022 : TechGoEasy

  • Hire me
  • Privacy Policy
  • Contact Us
  • New? Start Here
  • About Us