Drush, the DRUpal SHell, is a command line utility that lets us perform all kinds of Drupal tasks more quickly and efficiently than we can by clicking your way through the UI.
Here, I am trying to maintain the list of drush commands because, like me other experienced users also wants all the list at one place.
Note: All the commands need to be performed from within the directory of a Drupal installation.
To begin, first navigate our Drupal folder directory:
cd /var/www/[folder_name_of_drupal_directory]
Execute a drush command. Run `drush help [command]` to view command-specific help. Run `drush topic` to read even more documentation.
Global options (see `drush topic core-global-options` for the full list)
Command Description
-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)
-p, --pipe Emit a compact representation of the command for scripting.
-h, --help This help system.
--version Show drush version.
--php The absolute path to your PHP
intepreter, if not 'php' in the path.
Core drush commands: (core)
Command Description archive-dump (ard,archive-backup, arb) Backup your code, files, and database into a single file.
archive-restore(arr) Expand a site archive into a Drupal web site.
cache-clear (cc) Clear a specific cache, or all drupal caches.
cache-get (cg) Fetch a cached object and display it.
cache-set (cs) Cache an object expressed in JSON or var_export()
format.
core-cli (cli) Enter a new shell optimized for drush use.
core-cron (cron) Run all cron hooks in all active modules for specified
site.
core-rsync (rsync) Rsync the Drupal tree to/from another server using ssh.
core-status (status,st) Provides a birds-eye view of the current Drupal installation, if any.
core-topic (topic) Read detailed documentation on a given topic. drupal-directory(dd) Return path to a given module/theme directory. help Print this help message. See `drush help help` for more options. image-flush php-eval (eval, ev) Flush all derived images for a given style. Evaluate arbitrary php code after bootstrapping Drupal (if available). php-script (scr) Run php script(s).
search-index Index the remaining search items without wiping the index.
search-reindex Force the search index to be rebuilt.
search-status Show how many items remain to be indexed out of the total.
self-update(selfupdate) Update drush to the latest version, if available.
site-alias (sa) Print site alias records for all known site aliases and local sites. site-install (si) Install Drupal along with modules/themes/configuration using the specified install profile. site-upgrade (sup) Run a major version upgrade for Drupal (e.g. Drupal 6 to Drupal 7). A copy of the site is made, and then upgraded; the source site is not changed. test-clean Clean temporary tables and files.
test-run Run tests. Note that you must use the --uri option.
updatedb (updb) Apply any database updates required (as with running update.php).
variable-delete(vdel) Delete a variable.
variable-get (vget) Get a list of some or all site variables and values.
variable-set (vset) Set a variable.
version Show drush version.
watchdog-delete(wd-del, wd-delete) Delete 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-show(wd-show, ws) Show watchdog messages.
CTools commands: (ctools)
Command Description
ctools-export (ctex) Export multiple CTools exportable objects directly to code.
ctools-export-disable (cted) Disable CTools exportables.
ctools-export-enable(ctee) Enable CTools exportables.
ctools-export-info(ctei) Show available CTools exportable objects.
ctools-export-revert(cter) Revert CTools exportables from changes overridden in the database.
ctools-export-view(ctev) View CTools exportable object code output.
Field commands: (field)
Command Description
field-clone Clone a field and all its instances.
field-create Create fields and instances. Returns urls for field
editing.
field-delete Delete a field and its instances.
field-info View information about fields, field_types, and widgets.
field-update Return URL for field editing web page.
Project manager commands: (pm)
Command Description
pm-disable (dis) Disable one or more extensions (modules or themes).
pm-download (dl) Download projects from drupal.org or other sources.
pm-enable (en) Enable one or more extensions (modules or themes).
pm-info (pmi) Show detailed info for one or more extensions (modules
or themes).
pm-list (pml) Show a list of available extensions (modules and
themes).
pm-refresh (rf) Refresh update status information.
pm-releasenotes(rln) Print release notes for given projects.
pm-releases (rl) Print release information for given projects.
pm-uninstall Uninstall one or more modules.
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.
SQL commands: (sql)
Command Description
sql-cli (sqlc) Open a SQL command-line interface using Drupal's
credentials.
sql-connect A string for connecting to the DB.
sql-drop Drop all tables in a given database.
sql-dump Exports the Drupal DB as SQL using mysqldump or
equivalent.
sql-query (sqlq) Execute a query against the site database.
sql-sync Copy and import source database to target database.
Transfers via rsync.
User commands: (user)
Command Description
user-add-role (urol) Add a role to the specified user accounts.
user-block (ublk) Block the specified user(s).
user-cancel (ucan) Cancel a user account with the specified name.
user-create (ucrt) Create a user account with the specified name.
user-information (uinf) Print information about the specified user(s).
user-login (uli) Display a one time login link for the given user account (defaults to uid 1).
user-password (upwd) (Re)Set the password for the user account with the
specified name.
user-remove-role (urrol) Remove a role from the specified user accounts.
user-unblock (uublk) Unblock the specified user(s).
All commands in backup_migrate: (backup_migrate)
Command Description
bam-backup (bb) Backup the site's database with Backup and Migrate.
bam-backups Get a list of previously created backup files.
bam-destinations Get a list of available destinations.
bam-profiles Get a list of available settings profiles.
bam-restore Restore the site's database with Backup and Migrate.
bam-sources Get a list of available sources.
All commands in devel: (devel)
Command Description
devel-download Downloads the FirePHP library from http://firephp.org/.
devel-reinstall (dre) Disable, Uninstall, and Install a list of projects.
devel-token (token) List available tokens
fn-hook (fnh, hook) List implementations of a given hook and explore the
source of the selected one.
fn-view (fnv) Show the source of specified function or method.
All commands in devel_generate: (devel_generate)
Command Description
generate-content (genc) Create content.
generate-menus (genm) Create menus and menu items.
generate-terms (gent) Create terms in specified vocabulary.
generate-users (genu) Create users.
generate-vocabs (genv) Create vocabularies.
All commands in features: (features)
Command Description
features-add (fa) Add a component to a feature module. (DEPRECATED: use features-export)
features-components (fc) List features components.
features-diff (fd) Show the difference between the default and overridden state of a feature.
features-diff-all (fda) Show the code difference for all enabled features not in
their default state.
features-export (fe) Export a feature from your site into a module.
features-list (fl,features) List all the available features for your site.
features-revert (fr) Revert a feature module on your site.
features-revert-all(fr-all, fra) Revert all enabled feature module on your site.
features-update (fu) Update a feature module on your site.
features-update-all(fu-all, fua) Update all feature modules on your site.
All commands in search_api: (search_api)
Command Description
search-api-clear (sapi-c) Clear one or all search indexes and mark them for re-indexing.
search-api-disable(sapi-dis) Disable one or all enabled search_api indexes.
search-api-enable(sapi-en) Enable one or all disabled search_api indexes.
search-api-index (sapi-i) Index items for one or all enabled search_api indexes.
search-api-list (sapi-l) List all search indexes.
search-api-reindex(sapi-r) Force reindexing of one or all search indexes, without clearing existing index data.
search-api-server-disable (sapi-sd) Disable a search server.
search-api-server-enable (sapi-se) Enable a search server.
search-api-server-list (sapi-sl) List all search servers.
search-api-set-index-server (sapi-sis) Set the search server used by a given index.
search-api-status (sapi-s) Show the status of one or all search indexes.
All commands in views: (views)
Command Description
views-analyze (va) Get a list of all Views analyze warnings
views-dev (vd) Set the Views settings to more developer-oriented
values.
views-disable (vdis) Disable the specified views.
views-enable (ven) Enable the specified views.
views-list (vl) Get a list of all views in the system.
views-revert (vr) Revert overridden views to their default state. Make
sure to backup first.
Other commands:
(delete_all,fb_autopost,feed_import_base,libraries,multifield,rules,rules_scheduler,services,strongarm,variable_realm,views_bulk_operations)
Command Description
convert-field-collection Convert a field collection to a multifield
delete-all (da) Delete all nodes, nodes of a specific content type or users.
download-facebook-php-sdk (dl-fbsdk) Download and install the Facebook PHP SDK library.
feed-import-base-cron (feedcron) Runs feed import cron
feed-import-base-feed (feedimport) Imports specified feed
feed-import-base-list (feedlist) Show all available feeds
libraries-download(ldl, lib-download) Download library files of registered libraries.
libraries-list (lls,lib-list) Show a list of registered libraries.
rules-disable (rd) Disable a rule on your site.
rules-enable (re) Enable a rule on your site.
rules-list (rules) List all the active and inactive rules for your site.
rules-scheduler-tasks (rusch) Checks for scheduled tasks to be added to the queue.
services-security-up date-1 Run the updates for services 7.x-3.9 security update.
strongarm-revert Revert all strongarmed variables from code to the
database.
variable-realm-del Delete a variable for a specific realm and key.
variable-realm-get Get a variable for a specific realm and key.
variable-realm-set Set a variable for a specific realm and key.
vbo-execute Execute a bulk operation based on a Views Bulk
Operations (VBO) view.
vbo-list List all Views Bulk Operations (VBO) views, along with the operations associated with each.
No comments:
Post a Comment