I have a number of compressed files (*.tar.gz) in a directory. The file names have the created date in them. Each contains multiple files. I need to know the number of line that contain a specific word in a file with specific naming pattern. Is there a way to do this without uncompressing and storing every file?
Let’s say I have following files.
myfile.2023-01-01.tar.gz
myfile.2023-01-02.tar.gz
.......................
myfile.2024-01-01.tar.gz
myfile.2024-05-01.tar.gz
each file, when uncompressed, will contain multiple files as shown here.
access.log
access.123.log
config.log
config.456.log
config.3234.log
.....
I need to know the number of lines in the “config*” files that contain word “created”.