+1 vote
in Operating Systems by (77.2k points)
I want to determine the number of occurrences of a particular string in a zipped file. Is there any Unix command that I can use for it?

1 Answer

+2 votes
by (40.5k points)
selected by
 
Best answer

You can use the grep command in one of the following ways to find the number of occurrences of a string in a zipped file.

zcat zipped_file_name | grep "string" | wc -l

or

zcat zipped_file_name | grep -c "string"


...