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.


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


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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