Looking for how to view files in tar archive using single command under UNIX / Linux operating system? You don’t need to uncompress the .tar file in order to view the file content inside.
Tar command provides the option to list files inside compressed tarball. Use the Unix command as below to view the file in the .tar archive.
The command options of tar:
t: view contents
v: verbose mode
f: input from a file
Remember, you need to run gunzip first before the tar -tvf command if you have archive file with extension .tar.gz.
For file extension with .tar.bz2, you need to execute bunzip2 filename.tar.bz2 before tar -tvf to view the content in archive file.
Next» SSH Connection Closed By Remote Host