I want to use grep to search inside tar gziped archive and output the name of the file with match along with matched lines.
I thought to use `tar -tf archive.tar.gz` to list files then echo filename to terminal and extract then do grep search, but can't seem to find way as I've never used this `tar` tool and it has so many switches
I tried i.e. this (I didn't even get to `echo`):
tar -tf archive.tar.gz | xargs -0 tar -Oxf archive.tar.gz | grep something
but second `tar` command does not understand what xargs passes to it.
Am I on wrong path? Is there easier way to do this?