jeudi 15 janvier 2015

grep inside less?


I'm currently sifting through a lot of unfamiliar logs looking for some issues. The first file I look at is Events.log, and I get at least three pages in less which appear to display the same event at different times - an event that appears to be fairly benign. I would like to filter this event out, and currently I quit less and do something like



grep -v "event text" Events.log | less


This now brings a number of other common, uninteresting events that I would also like to filter out. Is there a way I can grep -v inside of less? Rather than having to do



egrep -v "event text|somethign else|the other thing|foo|bar" Events.log | less


It strikes me as a useful feature when looking at any kind of log file - and if less isn't the tool, is there another with the qualities I seek? Just a less-style viewer with built in less.



Aucun commentaire:

Enregistrer un commentaire