For more details about drush project, please see the Drush project page.
If you are using Windows, Git must be installed and the Git\bin directory must be in the path. Otherwise, you will not be able to run the command files. Please see Getting started with Git (for Drupal) on Windows for details.
The recommended installation instructions can be found here: http://docs.drush.org/en/master/install/
Abbreviated instructions for Unix-based (i.e. non-Windows) systems:
First install Composer globally.
$ curl -sS https://getcomposer.org/installer | php $ mv composer.phar /usr/local/bin/composer $ export PATH="$HOME/.composer/vendor/bin:$PATH" $ source ~/.bash_profile
These instructions do not apply to Linux systems, which do not have a .bash_profile.
If you use Linux, use .bashrc instead, do not create an empty .bash_profile, this will get you rid of the error: "No such file or directory found", but will not help with install.
So, for Linux, stop after the second line, and append the third to the end of your .bashrc, which is in your home directory, you can do this is as your user, whereas the previous instructions need to be run with elevated privileges, because /usr/local/bin is a system directory.
Reboot and then you can continue installing drush.
Now that you have Composer working, you can install Drush 7 from the latest HEAD.
$ composer global require drush/drush:dev-master
To update Drush:
composer global update
Specific instructions for other ways to install Drush on specific environments appears below.