How to permanently set $PATH on Linux/Unix
Learn how to permanently set $PATH on Linux/Unix.
You can set the PATH environment variable, using the following command.
export PATH=$PATH:/path/to/my/binary/file/
However, each time you exit the terminal or SSH session, and start a new terminal session, this PATH is lost. You have to run the same command again to recover the path. How can you permanently set this path?
Here are the step on how to resolve it.
1) cd ~
2) sudo nano .bashrc
3) Add the following line at the very bottom of file .bashrc.
export PATH=$PATH:/usr/local/go/bin
4) Save the .bashrc and exit.
5) ctrl + D to exit the terminal
6) Log back again.
#linux #ubuntu #path
by Rabi Gurung
linux ftp server
thank you for your usefull video, i have one question, is it possible to create a shell and and it set the path automaticlly in the bashrc after you run your bash for once?
I can't find .bashrc under ls -al command. Basically the problem I'm facing is I'm not able to use sudo commands outside of its own file which is annoying.
Thanks
thank you
How did you save it after typing the PATH command?
you saved my day, thank you
Thanks, this is easy and so useful
thanks man