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 -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -