Last updated 8 months ago
To print count matching lines we can use -c, --count argument with grep command.
-c, --count
grep
$ seq 100 | grep -c 5 19
Source: