5

I've tryed to add environment variable in terminal:

loom@loom:~$ export DOOM=/home/loom/doom/
loom@loom:~$ echo $DOOM 
bash: /home/loom/doom/: Is a directory

Then I've closed terminal and reopened it. However, there isn't $DOOM variable now. How to add environment variable via terminal?

0

1 Answer 1

8

Environment variables set like this are only stored temporally. When you exit the running instance of bash by exiting the terminal, they get discarded. To save them permanentally, write the export x=y commands into /etc/profile (for all users) or ~/.profile (for yourself) Do this by editing/creating (?) the file using your preferred text editor (as root for /etc/profile). Examples:

sudo nano /etc/profile
gedit ~/.profile
# etc... kate, leafpad, vim, whatever you want to use
4

Not the answer you're looking for? Browse other questions tagged .