问题:使用export添加完环境变量后未生效
解决:这是因为export添加的变量仅在当前shell会话有效,关闭会话就会失效了,建议将export存储在~/.bashrc中
方法:
vim ~/.bashrc 或 vim /etc/profile
export PATH=$PATH:/tmp/hello
问题:使用export添加完环境变量后未生效
解决:这是因为export添加的变量仅在当前shell会话有效,关闭会话就会失效了,建议将export存储在~/.bashrc中
方法:
vim ~/.bashrc 或 vim /etc/profile
export PATH=$PATH:/tmp/hello