Show Menu
Cheatography

Drush version 5-dev commands Cheat Sheet (DRAFT) by

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Core Commands

archiv­e-dump (ard, archiv­e-b­ackup, arb)
Backup your code, files, and database into a single file.
archiv­e-r­estore <br­/>arr
Expand a site archive into a Drupal web site.
cache-­clear cc
Clear a specific cache, or all drupal caches.
cache-get cg
Fetch a cached object and display it.
cache-set cs
Cache an object expressed in JSON or var_ex­port() format.
core-c­onfig conf, config
Edit drushrc, site alias, and Drupal settin­gs.php files.
core-cron cron
Run all cron hooks in all active modules for specified site.
core-e­xecute exec, execute
Execute a shell command. Usually used with a site alias.
core-q­uic­k-d­rupal qd
Download, install, serve and login to Drupal with minimal config­uration and depend­encies.
core-rsync rsync
Rsync the Drupal tree to/from another server using ssh.
core-s­tatus status, st
Provides a birds-eye view of the current Drupal instal­lation, if any.
core-topic topic
Read detailed docume­ntation on a given topic.
drupal­-di­rectory dd
Return path to a given module­/theme directory.
help
Print this help message. See
drush help help
for more options.
image-­flush
Flush all derived images for a given style.
php-eval eval, ev
Evaluate arbitrary php code after bootst­rapping Drupal (if availa­ble).
php-script
Run php script(s).
search­-index
Index the remaining search items without wiping the index.
search­-re­index
Force the search index to be rebuilt.
search­-status
Show how many items remain to be indexed out of the total.
self-u­pdate selfupdate
Check to see if there is a newer Drush release available.
shell-­alias sha
Print all known shell alias records.
site-alias sa
Print site alias records for all known site aliases and local sites.
site-i­nstall si
Install Drupal along with module­s/t­hem­es/­con­fig­uration using the specified install profile.
site-ssh ssh
Connect to a Drupal site's server via SSH for an intera­ctive session or to run a shell command
site-u­pgrade sup
Run a major version upgrade for Drupal (e.g. Drupal 6 to Drupal 7). A copy of the site is made, and then upgraded; the source site is not changed.
test-clean
Clean temporary tables and files.
test-run
Run tests. Note that you must use the --uri option.
updatedb updb
Apply any database updates required (as with running update.php).
variab­le-­delete vdel
Delete a variable.
variab­le-get vget
Get a list of some or all site variables and values.
variab­le-set vset
Set a variable.
version
Show drush version.
watchd­og-­delete wd-del, wd-delete
Delete watchdog messages.
watchd­og-list wd-list
Show available message types and severity levels. A prompt will ask for a choice to show watchdog messages.
watchd­og-show wd-show, ws
Show watchdog messages.

Field commands

field-­clone
Clone a field and all its instances.
field-­create
Create fields and instances. Returns urls for field editing.
field-­delete
Delete a field and its instances.
field-info
View inform­ation about fields, field_­types, and widgets.
field-­update
Return URL for field editing web page.
 

Project manager commands

pm-disable
Disable one or more extensions (modules or themes).
pm-dow­nload
Download projects from drupal.org or other sources.
pm-enable
Enable one or more extensions (modules or themes).
pm-info
Show detailed info for one or more extensions (modules or themes).
pm-list
Show a list of available extensions (modules and themes).
pm-refresh
Refresh update status inform­ation.
pm-rel­eas­enotes
Print release notes for given projects.
pm-rel­eases
Print release inform­ation for given projects.
pm-uni­nstall
Uninstall one or more modules.
pm-update
Update Drupal core and contrib projects and apply any pending database updates (Same as pm-upd­atecode + updatedb).
pm-upd­atecode
Update Drupal core and contrib projects to latest recomm­ended releases.

SQL commands

sql-cli
Open a SQL comman­d-line interface using Drupal's creden­tials.
sql-co­nnect
A string for connecting to the DB.
sql-drop
Drop all tables in a given database.
sql-dump
Exports the Drupal DB as SQL using mysqldump or equiva­lent.
sql-query
Execute a query against the site database.
sql-sync
Copy and import source database to target database. Transfers via rsync

User commands

user-a­dd-role
Add a role to the specified user accounts.
user-block
Block the specified user(s).
user-c­ancel
Cancel a user account with the specified name.
user-c­reate
Create a user account with the specified name.
user-i­nfo­rmation
Print inform­ation about the specified user(s).
user-login
Display a one time login link for the given user account (defaults to uid 1).
user-p­assword
(Re)Set the password for the user account with the specified name.
user-r­emo­ve-role
Remove a role from the specified user accounts.
user-u­nblock
Unblock the specified user(s).

All commands in devel

devel-­dow­nload
Downloads the FirePHP library from http:/­/fi­rep­hp.o­rg/.
devel-­rei­nstall
Disable, Uninstall, and Install a list of projects.
devel-­token
List available tokens
fn-hook
List implem­ent­ations of a given hook and explore source of specified one.
fn-view
Show the source of specified function or method.
 

Global Options

Global Options (see drush topic core-g­lob­al-­options for the full list)
-r <pa­th>, --root­=<p­ath>
Drupal root directory to use (default: current direct­ory).
-l http:/­/ex­amp­le.c­om­:8888, --uri=­htt­p:/­/ex­amp­le.c­om­:8888
URI of the drupal site to use (only needed in multisite enviro­nments or when running on an alternate port).
-v, --verbose
Display extra inform­ation about the command.
-d, --debug
-y, --yes
Display even more inform­ation, including internal messages.
-n, --no
Assume 'yes' as answer to all prompts.
-s, --simulate
Assume 'no' as answer to all prompts.
-p, --pipe
Simulate all relevant actions (don't actually change the system).
-h, --help
Emit a compact repres­ent­ation of the command for scripting.
--version
This help system.
--php
Show drush version.
-ia, --inte­ractive
The absolute path to your PHP intepr­eter, if not 'php' in the path.
 
Force intera­ctive mode for commands run on multiple targets (e.g.
drush @site1­,@site2 cc --ia
).