Drush 5 cheat sheet

seaurchininterpreterInternet και Εφαρμογές Web

7 Δεκ 2013 (πριν από 3 χρόνια και 6 μήνες)

77 εμφανίσεις

Global options
Option What it does
-r <path>, --root=<path> Drupal root directory to use (default: current
directory).
-l <http://example.com:8888>,
--uri=<http://example.com:8888>
URI of the drupal site to use (only needed in
multisite environments or when running on an
alternate port).
-v, --verbose Display extra information about the command.
-d, --debug Display even more information, including internal
messages,
-y, --yes Assume ‘yes’ as answer to all prompts.
-n, --no Assume ‘no’ as answer to all prompts.
-s, --simulate Simulate all relevant actions (don’t actually
change the system).
drush -r /sites/example.com/ command
Backup
Command (shorthand) What it does
archive-dump (ard) Backup your code, files, and database into a
single file.
drush ard --destination=/backup/example.com.tar
archive-restore (arr) Expand a site archive into a Drupal web site.
drush arr /backup/example.com.tar
sql-dump Exports the Drupal DB as SQL using mysql-
dump or equivalent.
drush sql-dump --result-file=/backup/example.com.sql
sql-drop Drop all tables in a given database.
Cache
cache-clear (cc) Clear a specific cache, or all drupal caches.
Clear all caches
drush cc all
image-flush Flush all derived images for a given style.
search-reindex Force the search index to be rebuilt.
Install / Update
pm-download (dl) Download projects from drupal.org or other
sources.
site-install (si) Install Drupal along with modules/themes/config-
uration using the specified install profile.
Download latest Drupal and install with the standard profile and root:password
account (uid=1)
drush dl --destionation=/sites/example.com
drush -r /sites/example.com si standard --account-name=root --account-pass-
=password
Updatedb (updb) Apply any database updates required (as with
running update.php).
pm-update (up) Update Drupal core and contrib projects and
apply any pending database updates (Same as
pm-updatecode + updatedb).
pm-updatecode (upc) Update Drupal core and contrib projects to latest
recommended releases.
Cron
core-cron (cron) Run all cron hooks in all active modules for
specified site.
Drush 5 cheat sheet
Log
watchdog-show (ws) Show watchdog messages.
watchdog-list (wd-list) Show available message types and severity
levels. A prompt will ask for a choice to show
watchdog messages.
watchdog-delete (wd-del) Delete watchdog messages.
Users
user-add-role Add a role to the specified user accounts.
user-block Block the specified user(s).
user-cancel Cancel a user account with the specified name.
user-create Create a user account with the specified name.
user-information Print information about the specified user(s).
user-login Display a one time login link for the given user
account (defaults to uid 1).
user-password (Re)set the password for the user account with
the specified name.
user-remove-role Remove a role from the specified user accounts.
user-unblock Unblock the specified user(s).
Modules
pm-download (dl) Download projects from drupal.org or other
sources.
pm-enable (en) Enable one or more extensions (modules or
themes).
Add views to site
drush dl views
drush en views -y
pm-disable (dis) Disable one or more extensions (modules or
themes).
pm-info Show detailed info for one or more extensions
(modules or themes).
pm-list Show a list of available extensions (modules
and themes).
pm-refresh Refresh update status information.
pm-releases Print release information for given projects.
pm-uninstall Uninstall one or more modules.
pm-update Update Drupal core and contrib projects and
apply any pending database updates (Same as
pm-updatecode + updatedb).
pm-updatecode Update Drupal core and contrib projects to latest
recommended releases.
Features
features-list (fl) List all the available features for your site.
features-export (fe) Export a feature from your site into a module.
Example where “my-new-blog-feature” is the name of your new feature into which
you are exporting a view called “blog”
drush fe my-new-blog-feature views:blog
features-update (fu) Update a feature module on your site.
features-update-all (fu-all) Update all feature modules on your site.
features-revert (fr) Revert a feature module on your site.
features-revert-all (fr-all) Revert all enabled feature module on your site.
features-diff (fd) Show a diff of a feature module.
Compiled by Mekaia.
Download this cheat sheet at http://mekaia.com/drush-cheatsheet.pdf or see more at http://drush.ws/help
drush <global options> <command> <command options>
Web development on Drupal.