0

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

9
  • Have you tried not including the "-" in front of xvf?
    – Univ426
    Oct 11, 2012 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, 2012 at 15:03
  • The file command returns "data" as the file type.
    – Petuga
    Oct 11, 2012 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, 2012 at 15:08
  • I have uploaded it via ssh tunnel (Tunnelier).
    – Petuga
    Oct 11, 2012 at 15:09

2 Answers 2

2

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.

1

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
2
  • [root@localhost ~]# file ./file.tar.gz ./file.tar.gz: data
    – Petuga
    Oct 11, 2012 at 15:06
  • So, looks like this file is nor tar archive, nor gzip. Probably it's already extracted.
    – GioMac
    Oct 15, 2012 at 13:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .