I wanted to be able to run program from anywhere without adding ./, so I edited ~/.bashrc to contain this line

export PATH=$PATH:.

Now when I type echo $PATH I get

[......]:/home/yotam/omnetpp-4.2.2/bin:.: No such file or directory

Why is that? Also, I'm not sure about why using export, I get the same result if I just type PATH=$PATH:more_valuew without export. So what's the difference?



Only the command contained to the directory described to the environment variable PATH can perform without ./ .

In this case, if you want to add current directory in PATH,

Replace to this:

export PATH=$PATH:./:

In General :

To make a temporary change the value of an environment variable enter the command:


This value will remain until you exit from the shell you are working in.

To make other programs that use the variable aware of the new value enter the command:

export VARNAME
  • Oh well the omnetpp is no really related to the issue, my bed. I just want to be able to run programs from anywhere so I want ./ to be in my PATH – Yotam Aug 16 '12 at 9:07
  • OK, I rewrote the above description. – vine_user Aug 16 '12 at 9:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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