I would like to check whether a file is in a gzip'ed tar archive.
For example I want to check whether the /etc/passwd is present in the archive backup_2010-09-27.tar.gz
A dumb solution can be:
tar -tzf backup_2010-09-27.tar.gz | grep '/etc/passwd'
But that takes time. Is there a better solution?
Best Answer
Try this (omit the initial slash):