I have a bash script called "myScript.bash" with:


( sleep 30 && /usr/local/bin/php /home/scripts/misc/code.php ) &
( sleep 60 && /usr/local/bin/php /home/scripts/misc/code.php )

I then do the following to make the bash script executable:

chmod +x /usr/local/bin/myScript.bash

It should run "code.php" every 30 seconds when I enter the following in the CLI:


Instead, I get:

-bash: myScript.bash: command not found.

What am I doing wrong?

  • yes. Even if I run it with the full directory I still get the error
    – GTS Joe
    Jul 1, 2019 at 21:11
  • What does ls -l /usr/local/bin/myScript.bash say?
    – SHawarden
    Jul 1, 2019 at 21:21

2 Answers 2


Most likely means that your current working directory isn't in the PATH (and that's a good thing).



If you want to run a script you have made executable, you have to write the entire path to run it, i.e.


If you only write


bash will search in PATH a file called script. Roughly, PATH is a list of directories where bash will search automatically files. Try

echo $PATH

If you open the terminal in the directory where script is, you may also write


You must log in to answer this question.

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