cat /proc/version
mac环境
1、cd ~
2、vi .bash_profile
如下配置:
export PS1="[\u@\h \W]\$ "
说明:
\u – 当前用户名
\h – 主机名hostname
\W – 当前目录
\w – 当前目录的完整路径
\d – 现在的系统日期
\t – 现在的系统时间
3、source .bash_profile
查看当前的版本
RedHat环境
vim ~/.bashrc
export PS1="[\u@\h \W]\$ "
Ubuntu环境
vim ~/.bashrc
找到这句
# If this is an xterm set the title to user@host:dircase "$TERM" in
xterm*|rxvt*)
#PS1="
\e]0;$debianchroot:+($debianchroot)\u@\h:\w\a
$PS1"
PS1="[\u@\h \W]\$ "
;;*)
;;
esac
将红色那句用#注掉,加上蓝色那句。