shell - How to make tail display only the lines that have a specific text? -


how make tail display lines have specific text? if search criteria can regular expression, better. need like: tail -f mylogfile.log showonlylineswith "error: "

i running darwin (mac os x) , i'm totally beginner in bash.

-- lot in advace

you can do

tail -f mylogfile.log | grep "error: " 

this works regular expressions too. in general, can take output of command, add | "pipe" grep, , let grep filter out lines don't match pattern.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

javascript - addthis share facebook and google+ url -

ios - Show keyboard with UITextField in the input accessory view -