LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Shell path and evironment path (https://www.linuxquestions.org/questions/linux-newbie-8/shell-path-and-evironment-path-773060/)

Dopamine 12-02-2009 05:08 PM

Shell path and evironment path
 
Hello

I am a bit confused about what environment PATH means. Is it just another name for PATH?
If i want to add a directory to my existing shell path, do i have to edit the shell .login files or can i do it while logged on?

Thanks for your time

pixellany 12-02-2009 05:15 PM

$PATH is part of your environment----it is one of the "environment variables". Enter "env" to see them all.

You can change $PATH at any time like so:

(add /opt/stuff to PATH)
Code:

export PATH="$PATH:/opt/stuff"
To make it permanent, you have to edit whatever startup script sets the final PATH. This differs between distros.

Dopamine 12-02-2009 05:24 PM

When i use the command to add a directory to my PATH, do i need to do anything to change my environment PATH or is the only way to do that by making it permanent in the start up files?

Also there is another path it is lower case, on my linux box it has the same values as the uppercase PATH , are these the same? (i ask because unix is usually case sensetive on everything)

Thank you!

chrism01 12-02-2009 06:00 PM

As Pixellany said, you can change it interactively any time for it to have immediate effect, but you must change the login file eg .bashrc or .bash_profile, for it to survive logging out and/or a reboot.

I've never seen a lowercase version; which distro/version and shell are you using?

pixellany 12-02-2009 09:01 PM

"PATH" and "environment PATH" are the same thing---PATH is simply one of the environment variables.

The PATH variable gets set during system startup--that's why a permanent change needs to go in a startup file somewhere.

evo2 12-02-2009 09:17 PM

Quote:

Originally Posted by chrism01 (Post 3777735)
I've never seen a lowercase version; which distro/version and shell are you using?

Hmm, lowercase $path, I have vague memories of that from tcsh.

Cheers,

Evo2.


All times are GMT -5. The time now is 06:54 AM.