gz format using tar -cvzf CentOS.ISO command as shown below.
Like previous methods, you can check the size of Source File using du -sh CentOS.ISO command. gz using tar command and extract using gunzip command as described below. gz file using gunzip commandĪnother method that can be used is that compress the source file to. ~]# du -sh CentOS.ISO 140M CentOS.ISO Method 3: Create. ~]# tar -zxvf CentOS.ISOĪfter extraction if you check the size of the Original File then it will show as 140M which is actual size when we compressed it in the beginning. gz file then you can use same tar tool to extract the file by using tar -zxvf command as shown below. gz file using du -sh command then you can see it is also compressed by 4.4% from the Source File. More can be checked on tar command Man Page. This command won't replace the Original file like in case of gzip tool instead it will create a separate output file as you have specified in the command.
Then you can compress the ISO image using tar -czvf CentOS.ISO command as shown below. First you need to verify the size of the source ISO image file using du -sh CentOS.ISO command as shown below. Here also we will use the same CentOS ISO image to demonstrate the extraction of. Like gzip you have another very useful tool available in most of the Linux based system is the tar tool. Display the name and percentage reduction for each file compressed or decompressed. ~]# gunzip -v : 4.4% - replaced with CentOS.ISO This command will give you the Original Source File CentOS.ISO by replacing the previous compressed file as shown in the output. If you want to extract the file then you need to use below gunzip -v command. This you can verify by using du -sh command as shown below. Display the name and percentage reduction for each file compressed or decompressed.Īs you can see above the generated image will be 4.4% smaller than the source file CentOS.ISO. ~]# gzip -v CentOS.ISO CentOS.ISO: 4.4% - replaced with gz compression on CentOS ISO Image using gzip -v CentOS.ISO command then you will see a file generated replacing the source file CentOS.ISO. Here size of CentOS.ISO image can be checked using du -sh CentOS.ISO command. gz file we will use a small CentOS ISO Image of size 140M as shown below. To demonstrate the usage of gzip tool to compress the file in. Similarly you can use gunzip, gzip and tar tool to extract. gz compression in Linux - gzip and tar tool. There are two popular tools which can be used to create. gz file you need to first understand the different methods through which.
gz File in Linux using gzip, tar and gunzip commandĪlso Read: 17 Useful Linux chown command examples to change owner and groupīefore going through the usage of gunzip command to extract. I have explained all the combinations in detail with the help of examples in below section which you can use as per tool availability and requirement.Įxtract. To do the compression and extraction of the files, you can use various combinations of gzip, tar and gunzip tool. This greatly helps the sender in sending a large file.Īt the receiver end same file needs to be extracted to the original file so that it will be used at the receiving end. gz compression to reduce the size and then send it over. If you need to send a very large file over a network or through some share network then it is always recommended to compress that file using.
gz file in Linux using gunzip, gzip and tar tool. In this article, I will take you through 5 Best Methods to extract.