Drupal: Install Drush on Mac/Linux

Drush is a command line shell and scripting interface for Drupal. With Drush you can easily configure your Drupal site with single line of command. Normally people would like to have visual interface to configure and manage the website because it feels much safer and fancy, but after all these years of experience about Drupal, I noticed that I was walking towards to the script world instead of visual interface world ever since the beginning. I am less and less passionate about the administration that Drupal provides, and more and more in love with putting my code in files (custom modules/themes). The way I code totally changed and I guess this is what it has to be.

On the Mac

  1. Go to somewhere you want to put the download files temporarily.

    $ cd ~/Desktop

  2. Download the latest Drush package.

    $ curl -O http://ftp.drupal.org/files/projects/drush-7.x-5.8.tar.gz

  3. Uncompress it.

    $ tar -zxf drush.tar.gz

  4. Move the drush folder to the suggested directory. You may need to input administrator password.

    $ sudo mv drush /usr/local/lib/

  5. Make it executable

    $ sudo chmod u+x /usr/local/lib/drush/drush

  6. Create link

    $ sudo ln -s /usr/local/lib/drush/drush /usr/bin/drush

And now you can go to a Drupal installation directory and try

$ drush help

If you have Homebrew, it supports Drush as well.

$brew install drush