I am running RHEL6, and I have exported an environment variable like this:
export DISPLAY=:0
That variable is lost when the terminal is closed. How do I permanently add this so that this variable value always exists with a particular user?
You can add it to your shell configuration file, e.g. $HOME/.bashrc
or more globally in /etc/environment
.
After adding these lines the changes won't reflect instantly in GUI based system's you have to exit the terminal or create a new one and in server logout the session and login to reflect these changes.