i wish to write the result of these below conditions in a file:
in a specific folder, i have many tar.gz files.
each tar.gz file contains ".dat" file in sub folders.
i wish to get the full path of these .dat files, if i find in it a specific word (" ERROR24 ").
all this wihtout extracting the tar.gz files
i have found and tested the below one that writes in a file the result, but i don't how to look in a tar.gz file.
there are too many tar.gz to be done manually...
You can't search / grep / analyze files that are compressed / zipped etc. with the "normal" *nix text tools as data are no text any more.
Did you consider e.g. zgrep ?
thanks for your advice.
so it means all i have to do is to test like that?
(i can't test right know... i don't have my linux laptop... tomorrow i'll be able to)
Literally true, even with tools like zgrep. What zgrep actually does is gunzip < inputfile | grep ... so decompression is not skipped, it just avoids making a temp file. And it's definitely not meant for tar files.