Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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

I've got a problem with Xterm.

When I use the command

tail -F example.log | grep -a -i -e 'examplestring'

in Xterm the "grepped" strings aren't highlighted in red like they would be in the normal terminal.

How can I fix this? Google didn't help me very much.

share|improve this question

Open terminal ( Ctrl + Alt + T ) and type

export GREP_OPTIONS='--color=auto'. This will highlight the matched pattern of grep

To set it to Red color use: export GREP_COLOR='1;31'

For more color options check out this page

enter image description here

share|improve this answer
Thank you!! Works perfectly! – Bannix Sep 23 '12 at 14:00

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.