0

I have a tar file that cannot be opened using the command below.

tar.exe -xvf filename.tar

The error given is:

tar.exe: Error opening archive: Unrecognized archive format

However, when I use the UI(WinRAR) to open the tar file, there are no problem. Another thing to note is that other TAR file has no problem being uncompressed using the command above.

Oddly the command works in WIN2008 server but not WIN2016 server.

What is the issue?

  • 4
    It's not a tar file. Winrar checks the file signature to decode it properly in the correct format instead of looking at the file extension. You need to find out the real format of that file – phuclv Aug 01 '21 at 12:59
  • 3
    Use the [file command](https://linux.die.net/man/1/file) to find the type: `file filename.tar`. – harrymc Aug 01 '21 at 20:49
  • Is there a windows equivalent to the file command? – user1535147 Aug 02 '21 at 01:12
  • 1
    no. You need to use 3rd party solutions [How can I determine file type without an extension on Windows?](https://superuser.com/q/274734/241386). If you have 7z just run `7z l filename.tar` to check. Alternatively if it's not sensitive then upload to many online file detection or antivirus services and they'll report that for you – phuclv Aug 02 '21 at 02:06
  • I used the `7z l filename.tar` method and the file type was tar. – user1535147 Aug 04 '21 at 02:59
  • You should rename the file so it is named just "filename" instead of "filename.tar" before using the `7z l filename` method. That way you'll be sure 7z doestn't take the easy way out. – svin83 Aug 05 '21 at 10:40
  • 1
    WinRAR shows the real file format at the Information dialog `(Alt+I)` – golimar Aug 06 '21 at 08:28
  • @svin83 It still show the file as tar after I remove the extension. – user1535147 Aug 09 '21 at 06:23
  • @golimar It still shows tar archive – user1535147 Aug 09 '21 at 06:25
  • Then it's a TAR file. Can you decompress it with 7z or WinRAR? – golimar Aug 09 '21 at 06:32
  • @golimar Yes I can. The problem now is why can't tar uncompress the file in WIN2016 server but was able to do so in WIN2008? – user1535147 Aug 14 '21 at 13:21

0 Answers0