Drush is a command-line shell and scripting interface for Drupal. It provides a set of commands which act as shortcuts to perform common tasks with Drupal sites. The purpose of this book is to explain Drush capabilities through practical examples. This chapter starts by showing some advanced examples and then focuses on installation, usage, and some basic concepts. The following chapters cover the command toolkit, customization, and extension.
These are the major things we will be covering in this chapter:
Imagine the following scenario: you have been told to clear the cache of a website called http://somewebsite.com. Normally, this would involve the following steps:
If you had Drush installed on your system, you would just need to open a terminal and execute the following command:
$ drush @somewebsite.com cache-clear all
That's it. You did not even have to provide user credentials. This little demonstration shows the potential that Drush has to simplify processes. Once you have configured Drush, you can do even cooler things such as downloading a database from a remote site to your local environment, excluding cache tables, and automatically resetting user e-mails and passwords with a command such as the following one:
$ drush sql-sync @somewebsite.com @somewebsite.local
Drush is a great tool to automate and speed up common tasks involving Drupal sites. If you have ever felt that you are doing the same thing many times, keep on reading to discover more effective ways to manage your Drupal sites!
3.141.31.209