Constantly change PATH on Ubuntu

I want to add to the PATH value ": / home / me / play /"
to install Play! framework.
so I ran this command:

PATH=$PATH:/home/me/play 

it worked. but the next time I checked, the value changed to the previous one.

therefore, I think I did not “save” the new meaning, did I?

how do you do it

+50
linux unix path ubuntu
Jul 29 2018-12-12T00:
source share
4 answers

Add

 export PATH=$PATH:/home/me/play 

to your ~/.profile and execute

 source ~/.bashrc 

to immediately reflect changes in your current terminal instance.

+67
Jul 29 '12 at 12:53 on
source share

Add the following line to your home directory .profile in your home directory (using vi ~/.profile ):

 PATH=$PATH:/home/me/play export PATH 

Then, for the changes to take effect, simply enter your terminal:

 $ . ~/.profile 
+82
Jul 29 '12 at 12:53 on
source share

Try adding export PATH=$PATH:/home/me/play to the ~ / .bashrc file.

+6
Jul 29 2018-12-12T00:
source share

Assuming you want to add this path for all users on the system, add the following line to /etc/profile.d/play.sh (and possibly play.csh , etc.):

 PATH=$PATH:/home/me/play export PATH 
+5
Jul 29 '12 at 15:37
source share



All Articles