Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

Peter

share|improve this question
    
Have you tried not including the "-" in front of xvf? –  John K Oct 11 '12 at 15:02
4  
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
1  
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
show 4 more comments

2 Answers

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

Otherwise:

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
add comment

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
add comment

Your Answer

 
discard

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.