How To Set Environment Variables In Ubuntu?
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 window and type the following command to open the .bashrc file in the gedit text editor:
sudo gedit ~/.bashrc
2. Add the following line at the end of the .bashrc file and save the changes:
export MYVAR=value
3. To apply the changes, run the following command in the terminal window:
source ~/.bashrc
4. To verify that the environment variable has been set, run the following command in the terminal window:
echo $MYVAR