January 11, 2011
drush - shell scripting interface for Drupal
drush [options] command...
drush is a veritable Swiss Army knife designed to make life easier for those of us who spend some of our working hours hacking away at the command prompt.
Drush core ships with lots of useful commands for interacting with code like modules/themes/profiles. Similarly, it runs update.php, executes sql queries and DB migrations, and misc utilities like run cron or clear cache.
|-r path, --root=path|
|Drupal root directory to use (default: current directory)|
|-l uri, --uri=uri|
|URI of the drupal site to use (only needed in multisite environments)|
|Display extra information about the command.|
|Hide all output|
|Display even more information, including internal messages.|
|-y, --yes||Assume ’yes’ as answer to all prompts|
|Simulate all relevant actions (don’t actually change the system)|
|-p, --pipe||Emit a compact representation of the command for scripting.|
|-h, --help||A detailed help system, use drush help help for complete help.|
|Show drush version.|
Drush is all based around "commands" that are usually defined in various modules.
This manual only lists a few of the most frequently used builtin commands shipped with the Drush core, since other Drupal modules and third-party "command files" may extend this list significantly. The canonical source of information for the available commands and their usage is the online help system.
|help||Print the help message. Use --filter to limit command list to one command file (e.g. --filter=pm).|
|Clear a specific cache, or all drupal caches.|
|Enter a new shell optimized for Drush use.|
|Run all cron hooks.|
|Provides a birds-eye view of the current Drupal installation, if any.|
|Evaluate arbitrary php code after bootstrapping Drupal.|
|Apply any database updates required (as with running update.php).|
|Get a list of some or all site variables and values|
|Set a variable.|
|Shows recent watchdog log messages. Optionally filter for a specific type.|
|Enable one or more extensions (modules or themes).|
|Disable one or more extensions (modules or themes).|
|Download projects from drupal.org or other sources.|
|Uninstall one or more modules.|
|Update Drupal core and contrib projects to latest recommended releases.|
|Update Drupal core and contrib projects and apply any pending database updates (Same as pm-updatecode + updatedb).|
|Open a SQL command-line interface using Drupal’s credentials.|
|A string for connecting to the DB.|
|Exports the Drupal DB as SQL using mysqldump.|
More information on each command is also available through drush help <command>. Most commands have shortcuts indicated in parenthesis.
Drush was originally developed by Arto for Drupal 4.7 (this alpha code can still be found in the DRUPAL-4-7 branch). In May 2007, it was partly rewritten and redesigned for Drupal 5 by frando. Since 2008, the module has been maintained by Moshe Weitzman, Owen Barton and Adrian Rossouw.
This manual page was written by Antoine Beaupré <anarcat> in June 2009 for the Debian project (but may be used by others).