Drush – Clear Cache and Cheat Sheet

Looking for a Drupal command line tool? Here you are. (Or jump to cheat sheet)
Drush – The command line tool for Drupal development

As a powerful tool, Drush provides much more functionality other than module management. For excample, you can clear the cache using the following Drush command.

drush cc

drush-clear-cache
 

Or you can clear all cache without being asked.

drush cc all

 

Very handy, isn’t it? Find out more about what Drush could offer in the following cheat sheet.

Project – Modules and Themes

drush dl [project]
Download Drupal core or project from drupal.org
drush pml
List projects (modules, themes)
drush rln [project]
Show project release notes
drush en [project]
Enable project
drush dis [project]
Disable [project]
drush pm-uni­nstall [project]
Uninstall a project
Cache and Cron

drush cc
Clear cache prompt
drush cc all
Clear all caches
drush cron
Execute scheduled operations
Update

drush upc
Download code updates
drush updb
Update database
drush up
Update code and database
Archive and Restore

drush sql-dump –resu­lt-­fil­e=../b­ack­up-­YYY­YMM­-DD.sql
Dump database to file
drush sql-drop
Drop all tables
drush sqlq –file­=../­ba­cku­p-Y­YYY­-MM­-DD.sql
Execute queries in a file
drush ard –dest­ina­tio­n=../b­ack­up-­YYY­Y-M­M-DD. tar
Create archive of entire site to a file
drush arr backup­-YY­YY-­MM-­DD.tar
Restore archive of entire site from file
Watchdog

drush wd-list
Show available watchdog types and severity levels
drush ws
Show watchdog messages
drush ws –type­=”access denied­” –tail
Watch for failed logins

Users

drush uinf [usern­ame­,ui­d,e­mail]
Display user inform­ation
drush upwd [username] –pass­wor­d=p­assword
Set password
drush uli [username]
Generate one-time login URL
drush ublk [usern­ame­,ui­d,e­mail]
Block user(s)
drush uublk [usern­ame­,ui­d,e­mail]
Unblock user(s)
drush ucan [username]
Cancel user
Variables

drush vget
Get a variable
drush vset
Set a variable
drush vset theme_­default [theme]
Set default theme
drush vset admin_­theme [theme]
Set admin theme
Help

drush
List all drush commands
drush help
Get help
drush help [command]
Help for a specific command

Reference: drush commands Cheat Sheet by FluxSauce

Advertisements

One thought on “Drush – Clear Cache and Cheat Sheet”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s