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

I am a Linux noob. I noticed that this does not work:

/tomcatDirectory/bin $ startup.sh //command not found

but this does work

/tomcatDirectory $ bin/startup.sh

I am used to Windows. It seems counter-intuitive to me that I can not run a program from its working directory, only from the parent folder.

What's the bigger picture of what's happening here?

share|improve this question
You could put that bin in your path. Add export PATH=$PATH:/tomcatDirectory/bin to ~/.profile. – goldilocks Feb 13 '13 at 14:11
up vote 5 down vote accepted

The current directory (i.e., .) is not in your path. Try with


You can check your path with

echo ${PATH}

You could add the current directory (.) to your path but this is considered a risk (especially if . is before other directories): when typing a command the shell will first try to execute it in the current directory. This will execute what is there instead of the default one.

Summarizing: just start executables in the current directory with ./ in front of them.

share|improve this answer
thanks so much. That explains it. – bernie2436 Feb 13 '13 at 14:22

Because "startup.sh" doesn't really look like a path to file and you don't have . in your PATH environment variable. But still you can start it as ./startup.sh

share|improve this answer

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.