drusha "quick" introduction
What is it?The Drupal shellAllows interaction with a Drupal site viacommand lineEasy to useReally useful (honest!)
InstallingLinux/OSX   pear channel-discover pear.drush.org   pear install drush/drushMay have to run with sudoMight also h...
InstallingWindowsInstaller Availablewww.drush.org/drush_windows_installerUsed to be almost unusable but appears to bebetter.
Using Drush
drushPrints a list of available drush commandsGood to see if you have installed it or not
drush help <command>Prints out help text for a command.
drush statusShows current status of a drupal siteOr just the version of drush if no site is found
drush pm-listList currently installed modules and themesUse --status to filter the list by status.Example:drush pm-list --...
drush pm-download <project>Downloads projects from Drupal.orgIncludes projects, themes and even DrupalitselfUse the --sele...
drush pm-releases <project>List the releases for a projectHelpful when using pm-download
drush site-install <profile>Install a site from the command line.--account-name to set master user username--account-pass ...
drush pm-enable <extension>Enable a module or theme.Use --yes to assume "yes" to promptsCan be shortened to "drush en <ext...
Live Demo!Full site install from the command line
drush pm-disable <extension>Disable a module or theme.Can be shortened to "drush dis <extension>"
drush pm-uninstall <extension>Completely remove a module from DrupalBasically runs the uninstall hooks
drush pm-updatecode <project>Update the code of an projectUse --security-only to only get security releasesUpdates the cod...
drush pm-update <project>Updates a projects code and applies anydatabase updatesSame as running pm-updatecode andupdatedb
drush cache-clear allClear all cachesCan use shortcut "drush cc all"Specify type of cache to clear or leave blank toprompt...
drush core-cronRun the cronCan also use "drush cron"
Interacting with searchdrush search-indexdrush search-reindexdrush search-statusNote: Need to have search module enabled!
Interacting with usersdrush user-block usernamedrush user-unblock usernamedrush user-password username --password=password...
Interacting with the databasedrush sql-dropdrush sql-dump --result-file=../mysite.sqldrush sql-query --file=../mysite.sql
...and many moreBarely scratched the surface here*Lots* more commands and flags availableFor a full list see:http://www.dr...
Drush Make
Drush MakeSort of like install profilesSingle subject in itselfUses a make file to download all neededmodulesMakes version...
drush make-generate <makefile>Generate a make file from an existing DrupalinstallNo need to know the make file syntax insi...
Example Make File; This file was auto-generated by drush makecore = 7.xapi = 2projects[drupal][version] = "7.x"; Modulespr...
drush make <makefile>Make a drush site using a make fileExample:drush make mysite.make
MOAR!!!I can haz moar commands?
Drush APIDrush has an API and so modules can plug into drush and allow additional commandsReference site:http://api.drush....
ViewsInteract with views from Drushdrush views-listdrush views-enable <view>drush views-disable <view>
Devel GenerateAdds devel generate support for drushCreate 10 nodes:drush generate-content 10Create 10 nodes, with 5 (or le...
ResourcesDrush Project Pagewww.drupal.org/project/drushMain Drush Sitewww.drush.orgDrush APIapi.drush.org/api/drush
Upcoming SlideShare
Loading in …5
×

Drush

1,728 views

Published on

A "quick" introduction to drush, the Drupal command line tool.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,728
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
14
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Drush

  1. 1. drusha "quick" introduction
  2. 2. What is it?The Drupal shellAllows interaction with a Drupal site viacommand lineEasy to useReally useful (honest!)
  3. 3. InstallingLinux/OSX pear channel-discover pear.drush.org pear install drush/drushMay have to run with sudoMight also have to run pear upgrade-allCan also use apt-get (might not be up to date)
  4. 4. InstallingWindowsInstaller Availablewww.drush.org/drush_windows_installerUsed to be almost unusable but appears to bebetter.
  5. 5. Using Drush
  6. 6. drushPrints a list of available drush commandsGood to see if you have installed it or not
  7. 7. drush help <command>Prints out help text for a command.
  8. 8. drush statusShows current status of a drupal siteOr just the version of drush if no site is found
  9. 9. drush pm-listList currently installed modules and themesUse --status to filter the list by status.Example:drush pm-list --status=enabled
  10. 10. drush pm-download <project>Downloads projects from Drupal.orgIncludes projects, themes and even DrupalitselfUse the --select to prompt for a certain releaseCan be shortened to "drush dl"
  11. 11. drush pm-releases <project>List the releases for a projectHelpful when using pm-download
  12. 12. drush site-install <profile>Install a site from the command line.--account-name to set master user username--account-pass to set master user password--db-url to set database connection stringExample:drush site-install minimal --account-name=admin --account-pass=admin --db-url=mysql://root:QWEqwe123@localhost/drupal7
  13. 13. drush pm-enable <extension>Enable a module or theme.Use --yes to assume "yes" to promptsCan be shortened to "drush en <extension>"
  14. 14. Live Demo!Full site install from the command line
  15. 15. drush pm-disable <extension>Disable a module or theme.Can be shortened to "drush dis <extension>"
  16. 16. drush pm-uninstall <extension>Completely remove a module from DrupalBasically runs the uninstall hooks
  17. 17. drush pm-updatecode <project>Update the code of an projectUse --security-only to only get security releasesUpdates the code only, use "drush updatedb"to also apply any database updates
  18. 18. drush pm-update <project>Updates a projects code and applies anydatabase updatesSame as running pm-updatecode andupdatedb
  19. 19. drush cache-clear allClear all cachesCan use shortcut "drush cc all"Specify type of cache to clear or leave blank toprompt for one
  20. 20. drush core-cronRun the cronCan also use "drush cron"
  21. 21. Interacting with searchdrush search-indexdrush search-reindexdrush search-statusNote: Need to have search module enabled!
  22. 22. Interacting with usersdrush user-block usernamedrush user-unblock usernamedrush user-password username --password=passworddrush user-information username
  23. 23. Interacting with the databasedrush sql-dropdrush sql-dump --result-file=../mysite.sqldrush sql-query --file=../mysite.sql
  24. 24. ...and many moreBarely scratched the surface here*Lots* more commands and flags availableFor a full list see:http://www.drush.org/help/5
  25. 25. Drush Make
  26. 26. Drush MakeSort of like install profilesSingle subject in itselfUses a make file to download all neededmodulesMakes version control easier
  27. 27. drush make-generate <makefile>Generate a make file from an existing DrupalinstallNo need to know the make file syntax insideand outExample:drush make-generate mysite.make
  28. 28. Example Make File; This file was auto-generated by drush makecore = 7.xapi = 2projects[drupal][version] = "7.x"; Modulesprojects[ctools][version] = "1.0"projects[devel][version] = "1.2"projects[google_analytics][version] = "1.2"projects[views][version] = "3.3"
  29. 29. drush make <makefile>Make a drush site using a make fileExample:drush make mysite.make
  30. 30. MOAR!!!I can haz moar commands?
  31. 31. Drush APIDrush has an API and so modules can plug into drush and allow additional commandsReference site:http://api.drush.org/api/drush
  32. 32. ViewsInteract with views from Drushdrush views-listdrush views-enable <view>drush views-disable <view>
  33. 33. Devel GenerateAdds devel generate support for drushCreate 10 nodes:drush generate-content 10Create 10 nodes, with 5 (or less) comments:drush generate-content 10 5(Make sure comment is enabled!)
  34. 34. ResourcesDrush Project Pagewww.drupal.org/project/drushMain Drush Sitewww.drush.orgDrush APIapi.drush.org/api/drush

×