nginx/1.17.3, GNU grep 2.27 and xterm-256color capable terminal (Xfce terminal) for some reason doesn't provide colored matches in its output. I've tried this:
But it simply doesn't highlight text, only meaningless wall of white text that is nginx compile options. $PS1 is colored, so terminal isn't inherently broken!
You need to redirect stderr
nginx -V 2>&1 | grep --color=always -e 'http'
Learn more about 2>&1 here: In the shell, what does " 2>&1 " mean?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With