3

linux 每次登陆时都需要 source ~/.bashrc 的问题

 1 year ago
source link: https://vpsxb.net/3960/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

最近安装mysql,cmake,可能是修改了 ~ /.bash_profie 配置文件,导致每次登录服务器都需要source ~/.bashrc以激活环境变量,才可以执行如ls 等的基本操作

解决方法1:配置~/.bash_profile

vi ~/.bash_profie
查看是否有以下代码,加入代码后如下所示:

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ] ; then
        source .bashrc
fi

source ~/.bash_profile
关闭Xshell, 重新打开一个窗口,发现问题已解决。

解决方法2:配置~/.bashrc

vi ~/.bashrc

写入以下内容:



  1. if [ -f /etc/bashrc ] ; then
  2. source .bashrc



https://www.jianshu.com/p/395bc4a939a8

https://www.cnblogs.com/iminifly/p/16618365.html


VPS小白 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK