how to set environment variable in linux ? I made my mind to build my carrer on linux and i just installed linux on my computer and i need to set environment variable. So how do we set 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.
Venkata Sai G M
This is how you can set environment variables in Linux, setting environment variables in Linux is a bit easier process. I’m also new to Linux while I’m going through this i have faced problem and found a way to set Environment variable in Linux i tried this and it worked. Maybe this can also help you
Easiest steps to set Environment Variables in Linux :-
[VARIABLE_NAME]=[variable_value]
1. As an example, create a variable called
EXAMPLE
with a text value. If you type the command correctly, the shell does not provide any output.2. The
set | grep
command confirms the creation of the variable. However,printenv
does not return any output.This is because the variable created in this way is a shell variable.
3. Another way to confirm this is to type
bash
and start a child shell session. Using theecho
command to search for theEXAMPLE
variable now returns no output: