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
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-uninstall [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 –result-file=../backup-YYYYMM-DD.sql
- Dump database to file
- drush sql-drop
- Drop all tables
- drush sqlq –file=../backup-YYYY-MM-DD.sql
- Execute queries in a file
- drush ard –destination=../backup-YYYY-MM-DD. tar
- Create archive of entire site to a file
- drush arr backup-YYYY-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 [username,uid,email]
- Display user information
- drush upwd [username] –password=password
- Set password
- drush uli [username]
- Generate one-time login URL
- drush ublk [username,uid,email]
- Block user(s)
- drush uublk [username,uid,email]
- 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
Reblogged this on Cutting Edge Linux.
LikeLike