Common Drupal 8 Drush Commands
It is essential for every Drupal developer to know how to use configure and use Drupal through Drush as it is a very valuable skill.
To get you started, below are some of the most common Drush commands for Drupal 8.
- Clear cache: drush cache-rebuild(To clear all caches) or drush cc (To delete one specific cache)
- Clear cache even when there’s some problem with Drupal: drush sql-query “DELETE FROM cache”
- Open SQL command-line interface: drush sql cli
- Print database connection details: drush sql-conf
- String for connection to database: drush sql-connect
- Enable a module: drush en {name_of_module}
- Disable a module: drush dis {name_of_module}
- Update a module: drush up {name_of_module}
- Update Drupal core and themes: drush pm-update drupal
- Check watchdog (logged events): drush ws
- Runserver (PHP’s built-in http server for development): drush runserver
The commands above are the ones we think might come in as most useful. To learn more about Drush and its commands, read the official documentation.