5

There are several formats of tar archives, ustar, gnu, etc. Is there some tool that can show which format a given archive is in? (Haven't found it in manpage of bsdtar nor in info pages of GNU tar).

3
  • Are you sure these actually produce different formats? en.wikipedia.org/wiki/Tar_(file_format)#Format_details implies that tar files follow POSIX IEEE P1003.1 Commented May 26, 2014 at 17:43
  • 2
    I normally just use : file <filename.tar> . I get (for example) : ./dojo-release-1.5.0.tar: POSIX tar archive (GNU) Commented May 26, 2014 at 22:13
  • Running tar --help I find out that it defaults to "--format=gnu". The generated file is not accepted on hackage.haskell.org with the message that it isn't in ustar format.
    – Magnus
    Commented May 27, 2014 at 18:07

2 Answers 2

3

As @FreudianSlip mentioned in the comments you can use file on an unix command line to check the format.

$ file archive.tar 
archive.tar: POSIX tar archive (GNU)
1
  • This can be used to differentiate GNU vs POSIX, but not USTAR. The reported format for USTAR is identical to that of POSIX.
    – mtalexan
    Commented May 6 at 17:27
1

Use 7Zip to open it then click Info button.
It will show information about compression methods and so on.
Click on Info button
By far 7Zip isn't the only program which can do it (it's my choice because it's open source and free), a lot of archivers can do the same.

3
  • That's good to know, but for home I'd really like a way that doesn't require me to first go out buying a license for an OS I don't particularly like :)
    – Magnus
    Commented May 27, 2014 at 18:15
  • @Magnus Which OS do you use? As I know there are a lot of versions for various systems (look here), but I'm not sure if they have UI.
    – Jet
    Commented May 28, 2014 at 8:55
  • I'm on Linux and I have the CLI version of 7z installed, but it offers no way to extract that information AFAICS.
    – Magnus
    Commented May 30, 2014 at 19:44

You must log in to answer this question.

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