临时环境变量
查看:echo $PATH
添加:export PATH=$PATH:/home/jdk/bin
永久环境变量
-
/root
目录下编辑.bashrc
,或者任意目录下编辑~/.bashrc
- 加入下面代码
PATH=$PATH:/home/jdk/bin
export PATH
- 运行
source .bashrc
,或者source ~/.bashrc
查看:echo $PATH
添加:export PATH=$PATH:/home/jdk/bin
/root
目录下编辑.bashrc
,或者任意目录下编辑~/.bashrc
PATH=$PATH:/home/jdk/bin
export PATH
source .bashrc
,或者source ~/.bashrc