Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Installation and Basic Usage You can see that Drush just prints its version info and the location of the loaded php. ini configuration file. Now, we are going to run drush core-status from the root of a Drupal directory with its settings.php file located at sites/default : $ cd /home/juampy/myDrupalSite $ drush core-status Drupal version Site URI Database driver Database hostname Database username Database name Database Drupal bootstrap Drupal user Default theme Administration theme PHP configuration Drush version Drush configuration Drush alias files Drupal root Site path File directory path : : : : : : : : : : : : : : : : : : 7.4 http://drupal7.localhost mysql localhost root drupal7 Connected Successful Anonymous bartik seven /etc/php5/apache2/php.ini 4.5 /home/juampy/myDrupalSite sites/default sites/default/files As you can see in the previous example, Drush discovers the site and prints its configuration details. Drush incorporates a killer feature to provide all the information needed to run a command against a Drupal site from any directory with just one parameter (for example, drush @mysite core-status ). It is called Drush site alias and it is explained in Chapter 3, Customizing Drush. There is another way of doing this which is with Drush configuration files, which will be explained as well. Summary After reading this chapter, you are ready to blast off. You have installed Drush and its software requirements and know how to do it in other operating systems. You tested some commands and understood how to use options and arguments with them. Finally, you found out that you can move around directories and still execute commands towards a particular Drupal site. In the next chapter, you will discover what each Drush command can do with a practical example. [ 26 ]