LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How do I change PATH? (https://www.linuxquestions.org/questions/linux-software-2/how-do-i-change-path-271200/)

trotsky 12-28-2004 12:20 PM

How do I change PATH?
 
How do I change PATH so that it stays that way? When I change PATH with "PATH=/mydir:$PATH" it just stays like that until I close the gnome-terminal window. I don't want to make a thousand shellscripts in a PATH directory that boot my program. So...how do I do it?

hw-tph 12-28-2004 12:31 PM

Edit your ~/.bashrc and see to that it's sourced from ~/.bash_profile (to make it apply at all times). Add something like this:
Code:

PATH=$PATH:/first/location:/second/location

Håkan

trotsky 12-28-2004 01:02 PM

thank you very much (tack så mycket) :). If I want this to apply to all accounts I just edit PATH in /etc/login.defs or...?

hw-tph 12-28-2004 01:07 PM

You can go ahead and add that line to /etc/profile or something along those lines as well.


Håkan

Ironica 12-28-2004 01:08 PM

/etc/profile


All times are GMT -5. The time now is 10:48 PM.