Useful drush commands

  • Posted on: 5 December 2018
  • By: stillfinder


Drush is a command line shell and Unix scripting interface for Drupal. 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.

Rebuild Drupal cache

../vendor/bin/drush -l cr

Rebuild Drupal routes

drush ev '\Drupal::service("router.builder")->rebuild();'

Reset admin password

./vendor/bin/drush -l uli

import Drupal's configs

../vendor/bin/drush -l cim

Export Drupal's configs

../vendor/bin/drush -l cex