Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

Server is running FreeBSD 9.2.

Using vim, I wrote the following script called hello:

echo "hello world"

Then I set it as executable:

>chmod 755 hello

Then I tried to run it from the command line (while in the same folder where the script was saved):


I got this error message:

hello: Command not found.

Is there something different I have to do to make an executable script in BSD?

share|improve this question
This is common to nearly every Unix-like system, and is not specific to (Free)BSD. – jw013 May 8 '14 at 17:47
up vote 4 down vote accepted

You must type:


If you type hello, the shell will try to find in $PATH any executable program named hello. In your case, you have not added your current folder to $PATH, so the shell can not find your program.

Dot . in ./hello represent your current working directory, so the shell can expand it to /full/path/to/hello.

share|improve this answer
Yes, my current folder is not in $PATH. This works, thank you. – sigil May 8 '14 at 17:48

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.