**cat /path/file | grep -Eoc “patern search for” **-E extend pattern -o only show matched pattern (not whole string) - c count

_or _

cat /path/file | gep -Eo “pattern search for” | wc -l -l : count line