How to permanently export a variable in Linux?

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.

Leave a Comment