在使用root用户是先建立了用户yunva的家目录,然后添加yunva用户,切换到yunva用户后发现
命令行变成了-bash-4.1$
①方法一(临时生效,不推荐) 1. bashrc 在当前目录下新建.bashrc文件: # touch ~/.bashrc # vim ~/.bashrc 并输入以下数据 # .bashrc # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi # User specific aliases and functions source以下使得其生效(临时生效): # source ~/.bashrc ②方法二(推荐) root用户下对yunva用户授权家目录: chown -R yunva.yunva /home/yunva将/etc/skel目录下面的.bash_profile,.bashrc,.bash_logout复制到/home/yunva即yunva用户的家目录下就可以了
cp /etc/skel/{.bash_profile,.bashrc,.bash_logout} /home/yunva