In case you didn’t already know, Drush is great. It can massively speed up the Drupal development process. Here are some of the commands I use again and again, so I’ve got them all in one place for reference.
Clear the CSS & JS aggregation cache
drush cc css+jsClear all caches
drush cc allTurn off CSS cache
drush vset preprocess_css 0 --yTurn off JS cache
drush vset preprocess_js 0 --yesDownload a module from drupal.org
drush dl module_name (the name.module file name without the .module part)Enable a module
drush en module_name -yDisable a module
drush dis module_name -yUninstall a module
drush pm-uninstall module_nameList all enabled modules
drush pm-list --status=enabled --type=module
drush pm-list --status=enabled --type=module --no-coreRun an install or update hook manually
Drupal 7
drush ev "module_load_install('mymodule');mymodule_update_1234();"Drupal 10
drush ev "\Drupal::moduleHandler()->loadInclude('mymodule', 'install');mymodule_update_1234();"Check the current schema version of a module
drush ev "print_r(\Drupal::service('update.update_hook_registry')->getInstalledVersion('mymodule'))"Clear feature cache
drush flRevert a Feature
drush fr feature_nameUpdate a Feature
drush fu feature_nameLet anonymous users view devel info
drush role-add-perm 'anonymous user' 'access devel information'In Drupal 6, this requires Permissions API module:
drush perm-grant ‘anonymous user’ ‘access devel information’
This seems to have been removed and replaced with a different syntax:
drush perm-grant --all-roles --permissions='access devel information'In Drupal 7, this is in core
Check the watchdog logs
drush watchdog-show --tailView full details of a specific log entry
drush ws 1234Delete/clear watchdog log
drush wd-del all