Drush, which stands for the “DRUpal SHell”, is a command line interface to Drupal that bills itself as a “swiss army knife” for Drupal developers. The rule of thumb is that if there’s a commonly run task that involves many clicks on a Drupal site, there’s probably a Drush command for it. Drush is also one of the best kept secrets in the Drupal community. Due to its nature it won’t end up in any Drupal.org usage lists, but there is no denying the improvement in workflow that people experience when starting to use it.
Because Drush 2.0 is no longer a module, you only have to install one copy of Drush on the server, and then you can use Drush on any Drupal 5, Drupal 6, and Drupal 7 sites you may have.
To run a Drush command just change into the Drupal root directory or the Drupal site directory that you want to run the Drush command on and type in ‘drush command’. You can get a list of Drush commands by typing:
As developers, we often get caught by caching problems when developing code. Drush provides a command for this. To let Drush clear all your caches for you, simply run :
drush cache clear
Another common task for developers and site maintainers is needing to run update.php when we update the code for a site. To script the update process all you need to do is to type:
Drush also provides a mechanism to download the latest module updates for you automatically through the update command, which also calls the updated command afterwards.To do this just run :
Here’s what that looks like:
There are many useful commands and great features in Drush – far more than is realistic to include here – and I recommend that you check it out for yourself to see how much time it could save you. Drush has a very flexible plugin architecture, which makes it ridiculously easy and a lot of fun to build Drush extensions, so the amount of functionality available through Drush is constantly expanding.
I’d like to thank my co-maintainers Moshe Weitzman and Owen Barton for helping to make this the most fun project that I’ve worked on in a while. And especially Owen, who took the time to fix our only remaining release critical bug last night, even though he has a brand new baby keeping him busy.
I would also like to specifically thank Vingborg for contributing the game changing patch that was the starting point of the 2.0 branch. Without his contribution, Drush and it’s dependent project Aegir would have been in a very different place right now, and we’d all be worse off for it.
Many other people contributed to this release, and it was a great experience working on the issue queue for the project during this release with such a large amount of great patches and cool new features being contributed at an amazing pace.
We already have a number of great features that are brewing for the next release, and with the final 2.0 release out in the world we can now focus on some of the crazy new functionality coming down the pipeline.