1. search for 1 word
http://stackoverflow.com/questions/7161821/how-to-grep-a-continuous-stream
tail -f /home/saiponduru/dev/pyr/pyr-greenzone/log/development.log | grep --line-buffered Rendered
2. search for multiple words
http://www.cyberciti.biz/faq/searching-multiple-words-string-using-grep/
tail -f /home/saiponduru/dev/pyr/pyr-greenzone/log/development.log | egrep -wi --line-buffered 'rendered|account'
OR
From pyr-greenzone directory -
tail -f ./log/development.log | egrep -wi 'rendered|account'
http://stackoverflow.com/questions/7161821/how-to-grep-a-continuous-stream
Turn ongrep
's line buffering mode.tail -f file | grep --line-buffered my_pattern
tail -f /home/saiponduru/dev/pyr/pyr-greenzone/log/development.log | grep --line-buffered Rendered
2. search for multiple words
http://www.cyberciti.biz/faq/searching-multiple-words-string-using-grep/
$ grep 'warning\|error\|critical' /var/log/messages
To just match words, add -w swith:
$ grep -w 'warning\|error\|critical' /var/log/messages
egrep command can skip the above syntax and use the following syntax:
$ egrep -w 'warning|error|critical' /var/log/messages
I recommend that you pass the -i (ignore case) and --color option as follows:
$ egrep -wi --color 'warning|error|critical' /var/log/messages
tail -f /home/saiponduru/dev/pyr/pyr-greenzone/log/development.log | egrep -wi --line-buffered 'rendered|account'
OR
From pyr-greenzone directory -
tail -f ./log/development.log | egrep -wi 'rendered|account'
No comments:
Post a Comment