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

Have a look at this terminal output...

bjorn@jungleland:~$ cd bin
bjorn@jungleland:~/bin$ ./ 
Hello World
bjorn@jungleland:~/bin$ cd ..
bjorn@jungleland:~$ pwd
bjorn@jungleland:~$ echo $PATH
bjorn@jungleland:~$ ./
bash: ./ No such file or directory

How come isn't found when I'm in my home directory? I have tried logging out and in again!

share|improve this question
up vote 6 down vote accepted

Because you are specifically running ./, i.e. a script called "" that is in the current directory (./). Whether it is in the $PATH or not is irrelevant. If you give a full path, as you are doing, the system will look for the executable at the path given. Compare the commands below:

/bin/ls      <-- works
ls           <-- works
../../bin/ls <-- works if you are in $HOME
./ls         <-- fails unless you are in /bin

What you want to run is instead of ./

share|improve this answer
Oh so that's what the ./ is for! That explains alot. I always figured it was some kind of way to tell bash I was trying to run a script, as opposed to invoking a native command. Thank you! – Björn Andersson Jan 10 '13 at 6:41

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.