change PATH permanently on Ubuntu
LinuxUnixUbuntuPathLinux Problem Overview
I'd like to add to PATH the value ":/home/me/play/"
for the installation of Play! framework.
so I ran this command:
PATH=$PATH:/home/me/play
it worked. but in the next time I checked, the value changed back to the old one.
so I guess I didn't "saved" the new value, right?
how do you do that?
Linux Solutions
Solution 1 - Linux
Add
export PATH=$PATH:/home/me/play
to your ~/.profile
and execute
source ~/.profile
in order to immediately reflect changes to your current terminal instance.
Solution 2 - Linux
Add the following line in your .profile
file in your home directory (using vi ~/.profile
):
PATH=$PATH:/home/me/play
export PATH
Then, for the change to take effect, simply type in your terminal:
$ . ~/.profile
Solution 3 - Linux
Try to add export PATH=$PATH:/home/me/play
in ~/.bashrc file.
Solution 4 - Linux
Assuming you want to add this path for all users on the system, add the following line to your /etc/profile.d/play.sh
(and possibly play.csh
, etc):
PATH=$PATH:/home/me/play
export PATH