Tuesday, August 2, 2011

List the content of a tar file

if You need to list the contents of a tar or tar.gz file on screen before extracting the all files.

List the contents of a tar file
$ tar -tvf file.tar

List the contents of a tar.gz file
$ tar -ztvf file.tar.gz

List the contents of a tar.bz2 file
$ tar -jtvf file.tar.bz2

1 comment:

  1. The first command can also be used in case of tar.gz, it seems so.

    ReplyDelete