#Perma enviroment vars in ubuntu
36 messages · Page 1 of 1 (latest)
what is zsh?
i assume bash since i don't know what that means
Bash and zsh are two different shells
They're the programs your terminal sends input to
idrk tbh, im using a contabo server and putty thats about as much as i can tell you lmao
You should be able to do echo $SHELL to see what shell is being run
/bin/bash
So you're using bash
yeah
You should have a .bashrc file in your user's root directory
Add the environment variable exports there
how do i do that?
It's just a shell script
So you set the envvars the same way you would in the terminal
i dont even know how to do that, this is my first time using linux
export NAME="Some value"
so if i just type that its perma?
In your bashrc it'll be available in your shell sessions
alright
still a bit confused tbh but i guess i will see if using export works
wait
so i have to edit .bashrc and then add the export lines in there?
Yes
That'll make those environment variables available any time your user starts a bash shell session
ohhh alright
how do i edit the file?
i tried some command like gedit but it dosent work
With a text editor
shall i open it in winscp?
I just do vim ~/.bashrc or nano ~/.bashrc
You'll have to restart your shell or re-source the rc file.