linux 配置环境变量不生效
解决普通用户 环境变量shell 退出不生效问题
1、在~/.bashrc 编辑了 scala
cat .bashrc
export SCALA_HOEM=/home/aipf/scala-2.11.12
export PATH=PATH:$SCALA_HOEM/bin
:wq
source ~/.bashrc
这样是永久生效的
但是有时候是退出shell,scala 命令不生效
cat .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/.local/bin:$HOME/bin
export PATH=/usr/loacl/sbin:/usr/local/bin:/sbin:/bin:/usr/bin:/usr/bin:/root/bin
export PATH
注释 #export PATH=/usr/loacl/sbin:/usr/local/bin:/sbin:/bin:/usr/bin:/usr/bin:/root/bin
退出,重新登录OK
第二种方法
在执行脚本时,执行完后
source ~/.bashrc 后
在检查
相关推荐
昭君出塞 2020-11-23
xiaoyuerp 2020-08-17
blankt 2020-08-15
Jieen 2020-06-18
IsanaYashiro 2020-05-28
lanyou00 2020-05-26
昭君出塞 2020-05-25
zhushixia 2020-05-20
pointfish 2020-05-19
Attend 2020-05-15
屿刃 2020-04-29
lfjjia 2020-05-07
xiaohouye 2020-05-06
playlinuxxx 2020-05-05
Sabrina 2020-05-03
学峰的学习笔记 2020-04-15
onetozero 2020-04-07
citic 2020-03-27