登陆服务器
cd
vi .bashrc
在尾部加入如下代码
if [ "$SSH_CONNECTION" != '' -a "$TERM" != 'linux' ]; then declare -a HOSTIP HOSTIP=`echo $SSH_CONNECTION |awk '{print $3}'` export PROMPT_COMMAND='echo -ne "\033]0;$HOSTIP:${PWD/#$HOME/~} \007"' fi
登陆服务器
cd
vi .bashrc
在尾部加入如下代码
if [ "$SSH_CONNECTION" != '' -a "$TERM" != 'linux' ]; then declare -a HOSTIP HOSTIP=`echo $SSH_CONNECTION |awk '{print $3}'` export PROMPT_COMMAND='echo -ne "\033]0;$HOSTIP:${PWD/#$HOME/~} \007"' fi