June 2, 2016

[SOLVED] Set hostname to to terminal window




Add this to your .bashrc file:

show only hostname

PROMPT_COMMAND='echo -ne "\033]0;${HOSTNAME}\007"'

show user@hostname and path

PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'

Source: http://tldp.org/HOWTO/Xterm-Title-4.html

No comments:

Post a Comment