Drush - Some Useful Commands - My Case Studies

Events happening in the community are now at Drupal community events on www.drupal.org.
You are viewing a wiki page. You are welcome to join the group and then edit it. Be bold!

Clean Site Cache

drush cc - List out the cache options to clear by choosing any of them

drush cc all - To clear all cache of site

drush cc drush - To clear drush cache

Download Projects or Modules or Themes

drush dl [project_name] or [module_name] or [theme_name] --destination=[path/to/save/files]

--destination => destination for the downloaded files

SQL Dump process

drush sql-dump --gzip --result-file=whatever.sql

--gzip => compress to gz format

--result-file => location of result file

SQL Import process

drush sql-cli > whatever.sql

Install Drupal project

drush dl drupal

Change location to downloaded drupal dir.

drush site-install standard --account-name=[SiteUsername] --account-pass=[SitePassword] --db-url=[mysql://YourMySQLUsername:YourMySQLPassword@[YourHost]/YourMySQLDatabaseName]

Zurb theme(sub-theme) install

drush dl zurb-foundation (Base-theme)

drush fst [SubthemeName]

drush help | grep watchdog

Recover password with Drush
Drush offers several ways of recovering the administrator's password.

Generate login-link

Drush can generate a one-time login link.

drush uli

Reset password

drush upwd --password="givememypasswordback" "admin"
(where "admin" is the user name)

Ref - http://www.drush.org/en/master/

Comments

Apply patch file

siva_drupal's picture

patch -p1 -R < path_to_patch.patch

Let's have discussion related

ramkrk's picture

Let's have discussion related to drush commands. @siva

Drupallers

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: