I've found the man pages to quite helpful.
from the man page for grep:
Quote:
General Output Control
-c, --count
Suppress normal output; instead print a count of matching lines for each input file. With the -v, --invert-match option (see below),
count non-matching lines. (-c is specified by POSIX.)
|
thus:
Code:
grep mytsring mylog.log
returns many results and
Code:
grep -c mystring mylog.log
will return an integer that indicates the # of hits grep finds.
regards