Scroll
List of useful Drush commands
Module download:
drush dl module1 module2
Module installation:
drush en module1 -y
Module removal:
drush pm-uninstall module1 -y
Module disable (without uninstalling config):
drush pm-disable module1 -y
Enable all required modules listed in a file:
xargs drush en -y < modules.txt
Drupal installation with selected Russian language:
drush si --db-url=mysql://root:password@127.0.0.1/drupal --account-name=admin --account-pass=admin --site-mail=admin@example.com --site-name="Drupal 8" --locale=ru --yes
Clear all caches:
drush cr
Run database updates:
drush updb -y
Export configuration:
drush config-export -y
Import configuration:
drush config-import -y
View a single config item (e.g., site name):
drush config-get system.site name
Set a config value (e.g., change site name):
drush config-set system.site name "New Site Name"
Show status info (PHP version, DB info, etc.):
drush status
List enabled modules:
drush pml --status=enabled
Uninstall Drupal (DANGEROUS!):
drush site:uninstall
Backup the site (DB and files):
drush ard
Restore a backup archive:
drush arr backup.tar.gz
The list of Drupal Drush commands will be updated regularly, so leave a comment on drupalbook.org about what you'd like to add to this list to always have the necessary Drush commands at hand.