Blog

Raw Notes: DrupalCampNYC8 Drush Intro or What Is It Good For

Presented by Robert Holmes (robbiethegeek)

(Got here a bit late, but caught the very beginning of drush command overview)

Handy drush commands

  • drush - listing of all the drush commands available to you
  • drush status - basic info on your site
  • drush sqlc (drush sql-cli) - takes you into MySQL console using the credentials of the site you're accessing with drush right now
  • drush dl <projectname> - downloads code for module (project) into sites/all/<projectname>; can list multiple projects at once
  • drush dl <projectname>-<version> - download a specific version of a module, e.g. drush dl filefield-6.x-3.x-dev
  • drush en <projectname> - enable <projectname>
  • drush up - upgrade code and database for Drupal core and third-party modules
  • drush sql-dump - Performs a dump of the current Drupal site's database. This will vomit it all over the screen, so instead you'll want to direct the SQL dump to a file using drush sql-dump --result-file=filename.sql or drush sql-dump > filename.sql (and then
  • drush cc - clear the cache that you then specify from the menu, or specify within the command as drush cc theme or drush cc all etc
  • drush help <command> - get help on the given drush command

Random Notes

  • You can use drush in conjunction with other shell commands, wrap drush commands in shell scripts, etc
  • Other modules can also expose functionality and add commands to drush, e.g. devel module
  • Drush supports the ability to remotely connect to a server - open an ssh connection, run a drush command, and bring it locally
  • http://dgo.to/ - Drupal URL shortener AND smartener with quick paths to projects, issue queues, nodes by number, users, etc

Comments

Post new comment

(If you're a human, don't change the following field)
Your first name.
The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.