+3 votes
in Operating Systems by (59.8k points)

I have a very large gzipped file and want to seach a text/substring in the file. I am using

zcat file_name | grep "pattern"


less file_name | grep "pattern"

But both of these commands are very slow. Is there any other command to search a gzipped file?

1 Answer

+1 vote
by (353k points)
selected by
Best answer

You can try zgrep . I am not sure if zgrep is faster than what you already used. Give a try.

zgrep "patten" file_name