如何在Linux中永久导出变量? [英] How to permanently export a variable in Linux?
本文介绍了如何在Linux中永久导出变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在运行RHEL6,我已经导出了一个这样的环境变量:
I am running RHEL6, and I have exported an environment variable like this:
export DISPLAY=:0
当CMD关闭时,该变量丢失。如何永久添加这个值,以使特定用户始终存在该变量值?
That variable is lost when the CMD is closed. How do I permanently add this so that this variable value always exists with a particular user?
推荐答案
您可以将其添加到您的shell配置文件,例如 $ HOME / .bashrc
或全球以上 / etc / environment
。
You can add it to your shell configuration file, e.g. $HOME/.bashrc
or more globally in /etc/environment
.
这篇关于如何在Linux中永久导出变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文