User:Gnyers/ShortTipsTerminal

Jump to: navigation, search

xterm title

Change the title of the terminal (or tab) to reflect the active session's user and host. This is very useful when opening many (SSH) sessions on different hosts as different users.

cat <<EOF > /etc/profile.d/xterm-title.sh
echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}"; echo -ne "\007"
EOF