preloader image
解决.bashrc文件每次打开终端都需要source的问题

解决.bashrc文件每次打开终端都需要source的问题

解决方法

配置~/.bash_profile

vi ~/.bash_profile

if [ -f ~/.bashrc ] ; then

source ~/.bashrc

fi

到这里,退出会话,重新登陆ssh,基本就可以解决每次登陆ssh后都要输入source ~/.bashrc命令的问题了, 如果还没有解决,继续配置~/.bashrc

配置~/.bashrc

vi ~/.bashrc

if [ -f /etc/bashrc ] ; then

source .bashrc

fi

说明

配置文件的执行顺序为:/etc/profile→ (~/.bash_profile | ~/.bash_login | /.profile)→/.bashrc →/etc/bashrc → ~/.bash_logout

Copyright © 2088 暴雪游戏怀旧特刊 All Rights Reserved.
友情链接