On my office computer it seems like I've have two PATH variables.

$path : This is delimited by " " (Space)

$PATH : This is delimited by ":" (Colon)

Though when I update one, the other one gets updated as well. Is this the normal behavior in Linux or is there something weird going on in my machine?

Should I keep them both, or delete one of them?

Edit: I'm using csh, I found this because some of my colleagues were updating the "path" variable, while others did it with PATH. Though I deleted all occurrences of updating PATH in my .cshrc, it still appears when I try to echo them.


1 Answer 1


The real PATH variable is the uppercase one, except in (t)csh itself where it's a little more complicated.

PATH is an environment variable, which all applications (not just shell) look up to invoke a program by name. The value of PATH is a string listing directory names separated by colons.

As a convenience, csh also provides a variable called path. The value of this variable is a list of strings, each string being a directory name. Whenever you set path, csh automatically sets PATH to the concatenation of the elements of path with : between elements.

If you set PATH with set, path is unaffected. Furthermore, csh set the PATH environment variable to match its path internal variable, so set PATH=... has no practical effect.

If you set PATH with setenv, path is updated accordingly. However setenv PATH … does not affect what $PATH expands to, which makes it awkward to use.

The upshot is that in csh, you should stick with path. But everywhere else PATH is the only one you'll see.

  • 1
    I should probably switch to BASH :D Commented Mar 6, 2014 at 5:27
  • @KartikAnand zsh! (Which also has both path and PATH, but there it's less confusing because there isn't the shell/environment variable (set/setenv) distinction: in zsh, if you set PATH in any way, path is updated and vice versa.) Commented Mar 6, 2014 at 9:53
  • will sure do!! Anyways why doesn't zsh need both environment and shell variables? I thought that was necessary. Commented Mar 6, 2014 at 10:29
  • @KartikAnand In Bourne-style shells (sh, ash, bash, ksh, zsh, …), environment variables are automatically shell variables with the same value. A shell variable is either exported (in which case it's also an environment variable, with the same value), or not (in which case there is no environment variable by the same name). This simplifies matters somewhat. Commented Mar 6, 2014 at 19:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .