

linux 每次登陆时都需要 source ~/.bashrc 的问题
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.

最近安装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
写入以下内容:
- if [ -f /etc/bashrc ] ; then
- source .bashrc
https://www.jianshu.com/p/395bc4a939a8
https://www.cnblogs.com/iminifly/p/16618365.html
转载请注明原文链接
Recommend
-
34
README.md My Dot Files This repository keeps all of my Dot files, which are compatible with Gnu/Linux machines. It includes dot files for VIM and Bash...
-
12
Did you know that you can automate scripts using ~/.bashrc /etc/rc.local ~/.profile. But the t...
-
18
【踩坑笔记】mac每次重启都需要重新ssh-add 问题:mac下解决开机需要每次ssh-add的问题,每次重启电脑后使用Git仓库,都会被提示:Enter passphrase for key, 然后...
-
25
在 minio 中, MinioClient 需要每次 new 一个吗?还是复用? V2EX › Java 在 minio 中, MinioClient 需要每次 new 一个吗?还...
-
4
Best of .bashrc Or, actually, .bash_aliases - but that's not as fun to say On this page I've gathered some selected bits and pieces from my .bash_aliases file. Apart from the selection of
-
2
V2EX › 程序员 登录服务器每次都需要动态验证码,神烦,有无自动填充方法 leiuu · 1 天前...
-
4
What are the most useful aliases in your bashrc or zshrc What are the most useful aliases or functions etc for bash that you’ve collected or written? Or bash scripts. Please give explanation/usage if necessary. O...
-
1
What Git aliases are in your .bashrc? I asked our contributors for their favorite and most useful Git aliases so that you could take advantage of their ideas.
-
5
Mac下“.bashrc”不生效 2016-06-29 新建”~/.bash_profile”,写入下面代码: if [ "${BASH-no}" != "no" ]; then [ -r ~/....
-
4
为什么行程卡每次都需要授权?
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK