Introduction to drush for drupal development

What is drush ?

Drush is very popular and useful tool for drupal developers. It provides us shell access to the drupal commands and functions which otherwise had to be accessed using the menus provided in the drupal administration. It helps us to enable/disable modules, installs  dependency modules automatically, manage users, permissions etc. For complete feature of drush browse this page.

In short drush is just like other command line tools 🙂 Sweet.

Drush official page is http://drupal.org/project/drush

drush was initially created for linux/mac environments however it can be run on windows as well.

Drush can be installed in linux,mac and windows. But runs faster in linux, at least I felt so personally.

For Ubuntu
Type the following command

[sourcecode language=’bash’]$ sudo apt-get install drush[/sourcecode]

when asked enter your computers password and hit enter

For Other Linux Distributions
Download the source from drush source extract it and then follow the readme.txt.

Actually you download the shell script for the drush and make it executable for the current user by adding the path to drush in environment variable so that it’s always available for the execution. To use Drush from the command line, you’ll need a CLI-mode capable PHP binary version 5.2 or greater.

For Windows
1. Visit http://drush.ws/drush_windows_installer
2. Download Drush 5.8 Windows Installer
3. Follow the Installation Guide

How to verify I you have installed drush successfully or not ?
– execute command ‘drush version’ at command prompt, it should show you output something like “drush verison 5.8”. It means you have successfully configured drush.

How to use drush ?
– cd into the root folder of your drupal project. For eg. my drupal project is in /media/BACKUP/htdocs/news/
– then I use “cd /media/BACKUP/htdocs/news”

Then to clear the cache I use “drush cc all” and response is

'all' cache was cleared in /media/BACKUP/htdocs/news#default                           [success]

You can try with other commands like “drush en module-name”

Hope this gives your short introduction on drush usage for drupal development. If you want to know more information about this then drop comments. Thanks.