您的位置:首页 > 运维架构 > Linux

Centos下新建用户命令提示符显示成…

2015-04-21 18:05 337 查看
Centos下新建用户命令提示符显示成_bash-4.1,如下图



原因是因为家目录下没有 .bash_profile和 .bashrc两个文件,有可能是新建时,家目录下已有和用户同名的目录,新建就好了,或者用root用户从别的用户下,copy过来

新建.bash_profile,
内容为:
#.bash_profile
# Get thealiases and functions
if [ -f ~/.bashrc ];then
.~/.bashrc
fi
#User specific environment and startupprograms
PATH=$PATH:$HOME/bin
exportPATH

 如图:



新建.bashrc文件

# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific aliases and functions


如图:



 最后:source下这两个文件就可以了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: