Tricks with .tgz files (includes listing the contents)

Ever wanted to know whats in a  .tgz file before opening it up and  expanding?

tar -ztvf <archive_name.tgz>

Once you have a list of whats in the archive, how about just extracting a single file from the archive?

# list the contents
tar -ztvf wwwbackup.tgz
# extract the file
tar -zxvf wwwbackup.tgz <path_to_file>/index.php
This entry was posted in FreeBSD Administration and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *