shell中配置文件读取顺序

/etc/profile→ (~/.bash_profile | ~/.bash_login | ~/.profile)→~/.bashrc →/etc/bashrc → ~/.bash_logout

在.bash_profile中:

if [ -f ~/.bashrc ] ; then
        source .bashrc
fi 

在.bashrc中:

if [ -f /etc/bashrc ] ; then
        source /etc/bashrc
fi 

转载:https://www.jianshu.com/p/35ad1b375e50

你可能感兴趣的:(shell中配置文件读取顺序)