I would like to ask whether in Unix shell/perl have any functions or command to allow grep/cat/read a file inside compressed .tgz without extract it?
I know we can tar tvf a compressed tgz but this only allow we read the path/filename contained inside the tarball. If we want to read the file, does it possible?
Let said I have a compressed file: test.tgz
It contains:
a.txt
b.txt
c.txt
abc.tgz
a.txt:
a
b
c
d
b.txt
1
2
3
d
c.txt
f
g
h
i
Can we grep files which contains "d" inside the compressed test.tgz without extract test.tgz? (some function like gzcat can read compressed file)