Skip to content

Instantly share code, notes, and snippets.

@bradwade
Created April 2, 2013 16:24
Show Gist options
  • Save bradwade/5293610 to your computer and use it in GitHub Desktop.
Save bradwade/5293610 to your computer and use it in GitHub Desktop.
Common Drush Commands

Drush Commands

Cache Clear

Clear all cache

drush cc all

Clear specific caches

drush cc

Then select which cache to clear

Clear Drush cache

drush cc drush

Especially on Pantheon aliases right after some major code updates, sometimes drush acts strangely and tells you that features module isn't installed for example.

Modules

You can get the module-name by the url path on drupal.org. For example http://drupal.org/project/jquery_update is the url. "jquery_update" is the module-name.

download module

drush dl <module-name>

enable module

drush en <module-name>

disable module

drush dis <module-name>

uninstall module

drush pm-uninstall <module-name>

Updates

Update all

drush up

Pantheon Update

drush up --no-core

Pantheon updates their custom pressflow core for you. You shouldn't overwrite it with vanilla Drupal.

update one module

drush pm-update --no-core <module-name>

On Drush 5.7 you can run the command drush pm-update --no-core module-name. Drush will automatically backup the current module, download the new version and prompt you to update the database.

Features

List features

drush fl

Difference between code and database

drush fd <feature-name>

Update feature

drush fu <feature-name>

Takes what is in database and overwrites what is in code.

Revert feature

drush fr <feature-name>

Takes what is in code and overwrites what is in database.

Theme

Enable theme

drush pm-enable themename

Disable theme

drush pm-disable themename

Show information about the theme

drush pm-info themename

List all theme

drush pm-list --type=theme

List enabled theme

drush pm-list --type=theme --status=enabled

Set default theme

drush vset theme_default themename

Set admin theme

drush vset admin_theme themename

show theme status

drush status theme

Nice Misc Ones

Update a password for a given Usernmae

drush upwd admin --password="mynewpassword"
@vaguity
Copy link

vaguity commented May 23, 2013

Turn off CSS and JS aggregation

drush vset preprocess_js 0
drush vset preprocess_css 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment