How To Add Environment Variable Linux?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
1. Log into your Linux account.
2. Enter the command “export” followed by the name of the environment variable you want to set and its value. For example, to set the environment variable “FOO” to “BAR”, enter the command “export FOO=BAR”.
3. To make the environment variable persist, you will need to add the export command to your shell configuration file. For example, if you are using the bash shell, you would add the command to your ~/.bashrc file.
4. Save the file and log out and back in again to make the environment variable available.