I have a file called
output.log which has this content:
Thread started Thread finished Thread started Thread finished Thread started Thread started
I monitor its output using:
tail -f output.log
I'd like to write a command to keep a count of how many threads are running right now. For the case above, the output would be:
2 threads are running
Should I perhaps use grep and somehow keep a tally of the string instances?