Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

Possible Duplicate:
Why is . not in the path by default?

This question might be trivial but I'm wondering why I have to type the dot and the slash before the name of my script in order to execute it, even though it is located in my current directory.


Whenever I type it without the dot & the slash:

I just get -bash: command not found

What is the reason behind putting the ./ in front of a script name?


share|improve this question

marked as duplicate by Nifle, Bobby, Joey, KronoS, Diogo Oct 31 '12 at 13:56

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Thanks! I think this already answered my question. – beta Oct 31 '12 at 13:52
I am late to the party, but you can symlink (ln -s /path/to/ /usr/bin/orig) it to your /usr/bin folder from your scripts directory (/usr/bin is in your $PATH) and then you can just type my_script (it even tab-completes). – nerdwaller Oct 31 '12 at 14:06
up vote 1 down vote accepted

You need to have your current directory in your PATH, export PATH=${PATH}:.

share|improve this answer
Note that having your current directory in your path is considered a security risk. There is a good reason this is not the default on multi-user systems. – Hennes Oct 31 '12 at 16:04
a better way would we to put user scripts to ~/bin and add this to your PATH variable. – l1zard Nov 1 '12 at 22:41
I added current directory as the last path since it's somewhat safer then have it first. The best is of course to be explicit and have them in ~/bin. – Jimmy Hedman Nov 14 '12 at 14:05

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