Ubuntu: tar commands returns stdin error



Question:

tar -xvfz files.tgz  gzip: stdin: not in gzip format  tar: Child returned status 1  tar: Error is not recoverable: exiting now  

This the error i got. (This file is created by tar -cvzf file.tgz file ) Moreover i can able to extract this same in another ubuntu server. I'm using AWS ec2 server. please someone help


Solution:1

Watch the ordering. The -f option represents the file, and it should be immediately followed by the file name. The proper command here is tar -xvzf files.tgz.


Solution:2

It's a tar file. Just rename the file or directory like files.tar

and then do tar -xvzf files.tar.

It will do the trick. I also faced the same error and resolved it on AWS.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »