linux command count a pattern occur in file

**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...

April 16, 2015 · 1 min · longka