How to display the hostname name in screen when you ssh into remote system? How to display the hostname name in screen when you ssh into remote system? unix unix

How to display the hostname name in screen when you ssh into remote system?


put this in .bashrc or .bash_profile

PROMPT_COMMAND='echo -ne "\033k$HOSTNAME\033\\"'


Does the "hostname" command work?

I suspect your solution will be terminal program specific. What is your terminal client? Take a look at http://kpumuk.info/mac-os-x/how-to-show-ssh-host-name-on-the-iterms-background/ .