How to permanently set $PATH on Linux/Unix

Published: 14 December 2022
on channel: Rabi Gurung
5,029
63

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


Watch video How to permanently set $PATH on Linux/Unix online without registration, duration hours minute second in high quality. This video was added by user Rabi Gurung 14 December 2022, don't forget to share it with your friends and acquaintances, it has been viewed on our site 5,029 once and liked it 63 people.