There is no ~/.bashrc to setup user $PATH

来源:互联网 发布:蜘蛛纸牌知乎 编辑:程序博客网 时间:2024/05/17 22:22

After add user in Ubuntu, there is no ~/.bashrc under user home for me to setup my own user $PATH.

 

1. man bash

 

When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads  and  executes  commands from  the  file  /etc/profile, if that file exists.  After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable.  The --noprofile option may  be  used  when  the  shell  is started to inhibit this behavior.

 

2. 

#touch ~/.bash_profile

#vim ~/.bash_profile

 

if [ -f ~/.bashrc ]; then

        . ~/.bashrc

fi

 

3.

#touch ~/.bashrc

#vim ~/.bashrc

export PATH=$PATH:....

 

 

 

 

 

 

 

原创粉丝点击