LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   PATH enviro var (https://www.linuxquestions.org/questions/linux-newbie-8/path-enviro-var-28141/)

nightvip 08-17-2002 02:24 PM

PATH enviro var
 
How do you add to the PATH enviromental var? I want to add to it but where do I do this.

mwtheobald 08-17-2002 02:54 PM

If you are using bash, then just edit the .bash_profile in your home directory. Add to the PATH=... line.

NSKL 08-17-2002 04:13 PM

PATH=$PATH: /path/to/be/added


Put that in ~/.bashrc


What it does: PATH= - should be clear, env PATH= (= can mean contains if you will)

$PATH means take the already existing content of PATH and put it back into PATH

":" just seperates the entries

/path/to/be/added - new path to be added. Then you can check it with

echo $PATH

If im not wrong, if you followed the last post you would have erased the content of PATH variable and assigned only the new path to it, in other words you would'nt be able to run any programs but the one you are trying to add.

Im learning BASH scripting, had to show off i learned somethin today :D




HTH


-NSKL

Mara 08-17-2002 06:38 PM

Global PATH (for all users) is kept in /etc/profile


All times are GMT -5. The time now is 12:03 AM.