Drupal-7: install a module using Drush

The Drush download and enable commands will find the recommended version of a module on Drupal.org and install it within the sites/all/modules directory of your Drupal 7 site.

The module is downloaded using the drush pm-download command. For example:

drush pm-download examples or, using the shortened version of the command drush dl examples

If the sites/all/modules/contrib directory exists, then Drush will automatically download the module into this subdirectory of the main modules directory.

After the module is downloaded, it can be enabled from the Druapl modules administration interface. It can also be enabled using the Drush pm-enable command like so:

drush pm-enable examples or drush en examples

Finally, all of this can be executed in one fell swoop by using the enable command with a default answer of "y" for the questions.

drush en examples -y

10 / 2019