Home » Questions » Computers [ Ask a new question ]

Simple use of 'tail' and 'grep'. Multiple conditions

Simple use of 'tail' and 'grep'. Multiple conditions

I'm trying to read a log file which is being written to by a simple daemon. I would like to filter my "live" output to certain - multiple - "types".

Asked by: Guest | Views: 224
Total answers/comments: 2
Guest [Entry]

"Try:
tail -f log.txt | egrep 'WARN|ERROR'"
Guest [Entry]

"This also works (regular grep and escape the pipe character):

tail -f log.txt | grep 'WARN\|ERROR'"