How To Set An Environment Variable In 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. Open the terminal.
2. Type in the command ‘export’ followed by the environment variable name and its value.
For example: export MYVARIABLE=value
3. To make the changes permanent, you can also add the command to the end of the ~/.profile file.
4. Finally, type ‘source ~/.profile’ to apply the changes.