1

I have a gz archive but for some reason tar said that the format is incorrect even though I can double click it in mac Finder and extract it normally, and file command shows the same format just like any other tar.gz files

Why is that and how to extract it from the terminal?

$ file archive.gz
archive.gz: gzip compressed data, original size modulo 2^32 4327594

$ tar -xzf archive.gz tar: Error opening archive: Unrecognized archive format

$ tar --version bsdtar 3.5.1 - libarchive 3.5.1 zlib/1.2.11 liblzma/5.0.5 bz2lib/1.0.8

phuclv
  • 2,086

1 Answers1

3

Your compressed file is probably not a Tar archive.

You can find out the uncompressed filename with gunzip -l archive.gz - that might give you a clue as to the format.

If that doesn't work, then gunzip it, and use file on the uncompressed output.

Toby Speight
  • 8,678