Grep only shows last match
- by Bannix
I've got a problem with grep.
When I use it as followed, it only shows the last match in every line and what follows after it.
For example:
If I use
tail -F example.log | grep -a -i -e "word1" -e "word2" -e "word3"
and example.log contains
word1 this word2 is word3 a test
only "word3 a test" will be displayed. How can I display the whole line and not only the last matched string in a line + rest of the line?
I hope you can understand what I mean and help me :)
Greetings, Bannix