Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Basically I want to combine the function whereby you can Less a file and then Shift+F to follow the file, as you would do with Apache's access.log.

However I would like the output to ignore/hide certain lines such as lines with .jpg in or lines with my own IP.



Actually managed to figure it out myself using:

tail -f /var/log/apache2/access.log|egrep -v '\.jpg|\.gif|\.js|\.css'

However the answer below seems a bit more elegant

share|improve this question
up vote 0 down vote accepted

Well, if there is a reasonably long list of stuff you want to ignore, you may want to use grep -f for file. Since logs tend to rotate, --follow=name means the file is reopened when rotated. Like so:

tail --follow=name /da/file | grep -vf /file/with/ignore.exprs
share|improve this answer
cool thanks very much :) I'd actually just managed to figure it out myself, but you can have your precious points since your version seems a bit tidier – DanH May 17 '11 at 7:07

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.