3

I frequently SSH into remote ubuntu servers to observe output.

What I'd like is certain terms (e.g. ERROR) to be colorized, (e.g. in red).

My understanding is that this is typically done by the shell, not the terminal. I do NOT want to change/install anything on remote servers however. I'd like this to be done at the terminal level, so that it would work on my local or remote box.

On Windows, some terminals support this, e.g. Mobaxterm.

mobaxterm

So I'm looking for something equivalent in Linux land.

4
  • 1
    +1 for mentioning Mobaxterm. I too have had this dilemma.. nothing on Linux seems to be able to do what MobaXTerm can do.. but in this case, I bet someone will know how to pull THIS off. Oct 18, 2021 at 12:39
  • Yip be hard to imagine Windows having the edge on something terminal related!
    – Nik
    Oct 18, 2021 at 17:43
  • The closest I can find is Hyper.is. It looks like maybe one could write a plugin for this, to highlight terms. But would rather have something a) out of the box, and b) not Electron based
    – Nik
    Oct 24, 2021 at 8:38
  • Thanks for this @Nik. You might need to write a plugin or to be honest, if it were me and it was making me crazy, I would probably write shell function to accommodate this. I too am an engineer (mostly c/c++ but "whatever" is fine). Oct 24, 2021 at 12:51

2 Answers 2

0

You could pipe your command to grep with color:

your-command | grep -E --color 'pattern|$'

This needs to be done per command though.


You can apply this for the whole shell, by making the your-command the shell itself:

bash | grep -E --color 'pattern|$'

enter image description here

1
  • Thanks Gauthier, but doing it per command is not going to work. And, making changes to the shell itself is also a no go. I want this at the terminal level, transparently, to every machine I connect to, without any other changes (like Mobaxterm)
    – Nik
    Oct 21, 2021 at 13:32
0

I think the less-standard terminal commands in Linux like Terminator and Terminology do the trick? See This list.

1
  • Thanks, I've looked at most (all?) of those, and some are great, but not found the feature I'm looking for.
    – Nik
    Oct 27, 2021 at 22:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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