I want to tail my development.log file, but i only want to show the lines that have the word "ERROR" in. How can i do this?? Doing this : tail -f development.log | grep "ERROR" will filter the log file, but it will not constantly update itself. i.e. newly added lines to the log file that contain "ERROR" are not displayed. Does anyone know how to do this? Thanks Chris
on 2006-06-05 12:35
on 2006-06-05 12:49
>>>>> "Chris" == Chris <email@example.com> writes: > Doing this : > tail -f development.log | grep "ERROR" > will filter the log file, but it will not constantly update itself. Oh, it does update. It just doesn't show the results to you as often as you'd like. The problem is that grep will use its normal I/O buffers, which are suited for reading from and writing to files. If you're using GNU or FreeBSD grep, try giving the --line-buffered option to it. -- Calle Dybedahl <firstname.lastname@example.org> http://www.livejournal.com/users/cdybedahl/ Please pay no attention to the panda in the fridge.
on 2006-06-05 13:20
Yeah that works, thanks Chris
on 2006-06-05 17:36
On Jun 5, 2006, at 6:47 AM, Calle Dybedahl wrote: > option to it. > -- > Calle Dybedahl <email@example.com> > http://www.livejournal.com/users/cdybedahl/ > Please pay no attention to the panda in the fridge. > _______________________________________________ If you have 'less', you can do: less -p'ERROR' development.log and use the 'F' command to follow the end like 'tail -f' does. This has the added benefit of being able to break out of the 'Waiting...' and peruse the log for a bit before continuing with another 'F'. -Rob Rob Biedenharn http://agileconsultingllc.com Rob@AgileConsultingLLC.com +1 513-295-4739