Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have just uploaded tar.gz archive to my Centos server from my home Windows 7 computer. Before that, it was extracted from .zip archive.

When I try to extract it:

tar -xvf file.tar.gz
gunzip file.tar.gz

It always give me error: "not in gzip format"

The archive is not corrupted, because it is possible to extract it in Windows with Winrar.

The archive is quite big, more than 100 MB.

I don't know, what's the problem. Could you help me please? Thanks.


share|improve this question
Have you tried not including the "-" in front of xvf? – Univ426 Oct 11 '12 at 15:02
Firstly, can we find out what the file really is; can you do a file file.tar.gz and post the results in your question? – MadHatter Oct 11 '12 at 15:03
The file command returns "data" as the file type. – Petuga Oct 11 '12 at 15:06
Then you might think it's not corrupt, but CentOS disagrees. A proper gzipped file should return "gzip compressed data...", an uncompressed tarfile "POSIX tar archive...". How did you transfer the file from the Win7 box? – MadHatter Oct 11 '12 at 15:08
I have uploaded it via ssh tunnel (Tunnelier). – Petuga Oct 11 '12 at 15:09

Are you sure you transferred the file from Windows to Linux in BINARY mode (if using FTP)?


If under linux system to extract files from the archive, use this:

tar -zxvf archive.tar.gz

This will both UNgzip and UNtar the files and directories.

share|improve this answer

Don't really understand this string: "tar -xvf file.tar.gz gunzip file.tar.gz"

tar xvf file.tar.gz

is enought to extract gzipped tar archive. Are you sure it is gzipped? Check with following:

file file.tar.gz
share|improve this answer
[root@localhost ~]# file ./file.tar.gz ./file.tar.gz: data – Petuga Oct 11 '12 at 15:06
So, looks like this file is nor tar archive, nor gzip. Probably it's already extracted. – GioMac Oct 15 '12 at 13:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.