How to list content from a tar file without recursion

compressionfilesystemsgziptar

I've a tar (gz, bzip) file and want to see its content, but not recursively.

This is: The "first level" in the file.

I already know how to see content:

tar -ztf file.tar.gz

But it's recursive!!

Thanks!

Best Answer

How about something like:

tar -ztf file.tar.gz | egrep '^[^/]+/?$'