How to i view the contents of a tar.gz file (filenames + filesize)

gzipsolaristar

I cannot use tar -tz as the solaris version I'm using does not accept the -z option.

I tried something like gunzip file.tar.gz | tar -tv but that only gives:

tar: /dev/rmt/0: No such file or directory

…and unzips the tar.gz to .tar which is undesired. I only want to look inside them without modification.

Best Answer

Don't have a Solaris box handy, but wouldn't something like zcat file.tar.gz | tar -tv do the trick? That might need to be gzcat or gunzip -c on Solaris, I'm not sure.

UPDATE: @Riccardo Murri points out that the default behavior of tar on Solaris is NOT to read from stdin (which seems very un-Unixish, but ce la vie), so zcat file.tar.gz | tar -tv -f - is probably what you need.

UPDATE 2: Finally found what looks to be a decent site for Solaris man pages, so I present to you man gunzip and man tar.

Related Question