Does grep offer a way to count the total number of matches it makes? The -c option only returns the number of lines that matched the regex, but in this case I have multiple matches per line.
Linux – Counting total number of matches with grep instead of just how many lines match
command linegreplinuxregexunix
Best Answer
try this:
well, -E is just an example, it could be -P, -F etc. point is -o
test: