修改ubuntu的终端提示符

修改/etc/profile文件为:

if [ "$PS1" ]; then
  if [ "$BASH" ] && [ "$BASH" != "/bin/sh" ]; then
    # The file bash.bashrc already sets the default PS1.
    # PS1='\h:\w\$ ' ,下面是添加的
    export PS1='[/u@/h /W/]/$ '
    if [ -f /etc/bash.bashrc ]; then
      . /etc/bash.bashrc
    fi
  else
    if [ "`id -u`" -eq 0 ]; then
      PS1='# '
    else
      PS1='$ '
    fi
  fi
fi

然后,让其生效:

source /etc/profile

 

posted on 2013-04-19 15:58  K's Blog  阅读(1553)  评论(0编辑  收藏  举报

导航