Open In App

How to Solve gzip: stdin: Not in gzip Format Error

Last Updated : 30 Jan, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

In this article, we will discuss the solution for the error gzip: stdin: not in gzip format and what is the reason behind this error.

What Could Be the Reason for the error?

This error generally occurs when the user has created a simple tar file using the options(-cvpf), where

  • c: create a new archive
  • v: verbose
  • p: extract information about file permissions (default superuser)
  • f: use archive file

but at the time of extraction, a user tries to extract the file as a gzip file type using the options (-xzpf), where

  • x: extract the file from the archive
  • z: zgip file type
  • p: extract information about file permissions (default superuser)
  • f: use archive file

Difference between Tar, Zip, and Gz

Basis Tar Zip Gz
Definition Tar is a utility which was designed to combine the multiple files into single file. Zip is a utility that came in MS-DOS which is used for file compression.  Gz is a file extension that is used with gzip archive file.
Space efficiency It takes highest number of memory space. It takes sometime highest or moderate number of memory space. It takes least number of memory space.
Operating System supported Unix and Linux operating system Unix, Linux, Windows, Macintosh, Minix, Atari, Amiga, VMS, MS-DOS etc. Unix and Linux operating system.

Solution for the gzip: stdin: not in gzip format error

1. To solve the error, first, we need to check the file type.

file demo.tar.gz

 

2. As it is clearly shown this is not a gzip archive file but it is a POSIX archive file.

3. So, we got the almost solution to the problem. hence we need to extract the POSIX archive file using (-xvpf) options.

tar -xvpf demo.tar.gz

 

Conclusion

On the above article, it describes about an error when users uses different tar command options for creation and extraction. So, for solving this query first we need to look after the file type of the archive file. The ‘file’ command in Linux comes in handy and then we can use multiple of tar command options to solve this problem.


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads