Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On my Linux machine some of the environment variables contain lists of directories. The directories are separated by :. But sometimes they are separated by ::. Is it just a mistake that should be treated as : or it means that and empty string is one of the directories (that probably should be interpreted as the current directory).

Most of the directories specified in the environment variables have this format:


However, some of them have this format:


Note double slash between bbb and ccc. Is it just a mistake that is interpreted as a single slash or it has a special meaning?

share|improve this question

The double-colon (::) does indeed mean the current directory. The Bash manual describes PATH as:

A colon-separated list of directories in which the shell looks for commands. A zero-length (null) directory name in the value of PATH indicates the current directory. A null directory name may appear as two adjacent colons, or as an initial or trailing colon.

But personally, I think it's better to explicitly specify the current directory (e.g., /foo/bar:.) for clarity.

As for the slashes, any number of adjacent slashes is treated as a single slash.

share|improve this answer

multiple '/' separators are ignored:

$ cd .////somedir

is equivalent to

$ cd somedir

As for the extra separators in your PATH, a little experimentation suggests that they are also ignored.

At least, this:

/home/jon.kiparsky:2040 $ echo $PATH

did not break my path! :)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.