

I just right click on the terminal to change the profile to whatever I feel like it should be in the moment (usually red). I do it by reflex, basically. I never felt the need to try to set up automation for different servers, but I expect there’s probably a way to do that if you really wanted to.
netstat -tp
– that’ll show you TCP connections and the associated program, doing a DNS lookup for the IPs they’re connected to. You may need elevated permissions to see what some processes are.There are a bunch of other options (e.g.
-n
to get numeric output instead of looking up names,-l
to get programs listening for incoming connections, etc); check the man pages for more details.