Why does drush say "command not found" when I try to execute remote commands? When I use a drush command to do something on a remote machine, I get the following message:


  bash: drush: command not found


What's the problem?
This message is from the remote machine complaining that it didn't understand where to find the drush executable, not Drush complaining that it can't find the (sub)command you may be trying to give it, even though the punctuation suggests the latter. (If bash: means Bash is  passing you a message, then drush: should mean the same thing--if there's any consistency. But actually it is intended to mean drush: is the subject of the message, not the source of the message passed through bash: to you.  It would be clearer if the second : were removed.)

Drush logs into your remote machine over ssh, but it's not a normal interactive login, so it doesn't source the .bash_profile.  It does, however, source the .bashrc file.

Add the drush path (not including drush itself, just including the directory containing drush) to the PATH variable in your remote .bashrc and all should be well.  For instance, that may look like this:

PATH=$PATH:/usr/local/zend/bin