List the contents of a tar or tar.gz file


List the contents of a tar file

<code>tar -tvf file.tar</code>

List the contents of a tar.gz file

<code>tar -ztvf file.tar.gz</code>

List the contents of a tar.bz2 file

<code>tar -jtvf file.tar.bz2</code>

Options:
-t
List the contents of an archive
-v
Verbose mode
-z
Use gzip so that you can process a compressed (.gz) tar file
-j
Use bzip2, use to decompress .bz2 files
-f
filename Use archive file called filename

This post is also available in: Greek

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.