grep ( -c option )

UNIX Command

$grep -c pack  resume.txt
0
$grep -c Linux  resume.txt
9
$grep -c Lin  resume.txt
9
$grep -c Li  resume.txt
9
$grep -c L  resume.txt
15
$grep -c engineer  resume.txt
2
$grep -c 1976  resume.txt
1
$grep -c GNU  resume.txt
5
$

UNIX Explanation For (grep -c)

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

Leave a comment

Your email address will not be published. Required fields are marked *