Q. How do I list the contents of a tar or tar.gz file?
A. GNU/tar is an archiving program designed to store and extract files from an archive file known as a tarfile. You can create a tar file or compressed tar file tar. However sometime you need to list the contents of a tar or tar.gz file on screen before extracting the all files.
Use the following command:
$ tar -tvf file.tar
Use the following command:
$ tar -ztvf file.tar.gz
Use the following command:
$ tar -jtvf file.tar.bz2
Where,
This post is from http://www.cyberciti.biz/faq/list-the-contents-of-a-tar-or-targz-file