How To Set Env 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.
To set environment variables on Linux, you will need to edit the .bashrc file in your home directory. To do this, open a terminal window and enter the following command:
nano ~/.bashrc
This will open the .bashrc file in the Nano text editor. You can then add environment variables to the end of the file, for example:
export MY_VAR=”value”
Once you have added the variables you want, press Ctrl-X to close the file and save your changes. To make the changes take effect, you will need to either log out and log back in or run the following command:
source ~/.bashrc