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

I'm on OSX Snow Leopard.

Here's the full contents of


echo wow

When I try to run it from terminal:

-bash: command not found
$ /bin/sh
$ sh
$ bash

Okay. Fair enough. I'll give it executable permission, then try again:

$ chmod +x
-bash: command not found
$ chmod 755
-bash: command not found

Hmmm. Maybe it'll work if I use bash explicitly? I'll change the file's contents to:


echo wow

And I get the exact same results. What could I have broken?!

One last thing! In case you're curious...

$ which sh
share|improve this question
up vote 16 down vote accepted

Absolutely nothing. Only executables in one of the directories in $PATH can be run directly, and . is (usually) never in $PATH. Specify the path to the executable, i.e. ./

share|improve this answer
+1. Also of note, the current directory is on the path on Windows systems by default, and is highest in priority. This crucial difference is probably the source of the asker's confusion. – afrazier Jun 1 '11 at 4:57
You were first by 9 seconds! Thank you! – Closure Cowboy Jun 1 '11 at 4:59

Is the location of in the $PATH variable? If not, you'll need to enter:


if you are in the same folder as If not, then provide the full path to it.

share|improve this answer

Yeah, and what ./ means, is that in this directory, run the command The single . means in the working directory. Otherwise, your shell assumes you are trying to run a command in your $PATH.

share|improve this answer

the permissions for the file are wrong. Try the following commands:

  $ chmod 777
  $ ./
share|improve this answer

You must log in to answer this question.

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