Drush in Drupal

Its a combinations of two words : Drupal + Shell = DruSh

Drush is a shell-based application used to control, manipulate, and administer Drupal sites. On the surface, drush is an excellent tool for updating site modules, but here is a more comprehensive list of features for drush.

Below Command will install Drush on system...

$ sudo apt-get install drush

To see all the commands about Drush on system :

$ drush help [command]

Core drush commands:

  Command (Alias) Description
backup-migrate    
  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
cache    
  cache-clear (cc) Clear a specific cache, or all drupal caches.
  cache-get (cg) Fetch a cached object and display it
  cache-rebuild (cr, rebuild) Rebuild a Drupal 8 site and clear all its caches
  cache-set (cs) Cache an object expressed in JSON or var_export() format
coder    
  coder-format Re-format and rewrite code according Drupal coding standards
coder-review    
  coder-review Run code reviews
config    
  config-delete (cdel) Delete a configuration object
  config-edit (cedit) Open a config file in a text editor. Edits are imported into active configuration after closing editor
  config-export (cex) Export configuration to a directory
  config-get (cget) Display a config value, or a whole configuration object
  config-import (cim) Import config from a config directory
  config-list (cli) List config names by prefix
  config-pull (cpull) Export and transfer config from one environment to another
  config-set (cset) Set config value directly. Does not perform a config import
core    
  archive-dump Backup your code, files, and database into a single file
  archive-restore (arr) Expand a site archive into a Drupal web site
  core-cli (php) Open an interactive shell on a Drupal site
  core-config (conf, config) Edit drushrc, site alias, and Drupal settings.php files
  core-cron (cron) Run all cron hooks in all active modules for specified site
  core-execute (exec, execute) Execute a shell command. Usually used with a site alias
  core-init (init) Enrich the bash startup file with completion and aliases. Copy .drushrc file to ~/.drush
  core-quick-drupal (qd, cutie) Download, install, serve and login to Drupal with minimal configuration and dependencies.
  core-requirements (status-report, rq) Provides information about things that may be wrong in your Drupal installation, if any
  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
  do:sanitize (do-sanitize) Performs database sanitization
  drupal-directory (dd) Return the filesystem path for modules/themes and other key folders
  entity-updates (entup) Apply pending entity schema updates
  help Print this help message. See `drush help help` for more options
  image-derive (id) Create an image derivative
  image-flush (if) Flush all derived images for a given style
  new-status  
  php-eval (eval, ev) Evaluate arbitrary php code after bootstrapping Drupal (if available).
  php-script (scr) Run php script(s).
  queue-list Returns a list of all defined queues
  queue-run Run a specific queue by name
  sanitize:comments (sanitize-comments) Sanitizes comments_field_data table
  sanitize:sessions (sanitize-sessions) Truncates the session table
  sanitize:table-column (sanitize-table-column) Replaces all values in given table column with the specified value
  sanitize:user-fields (sanitize-user-fields) Sanitize string fields associated with the user
  shell-alias (sha) Print all known shell alias records
  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-set (use) Set a site alias to work on that will persist for the current session
  site-ssh (ssh) Connect to a Drupal site's server via SSH for an interactive session or to run a shell command
  sql-sanitize (sqlsan) Run sanitization operations on the current database
  twig-compile (twigc) Compile all Twig template(s)
  updatedb (updb) Apply any database updates required (as with running update.php).
  updatedb-status (updbst) List any pending database updates
  variable-delete (vdel) List any pending database updates
  variable-get (vget) Get a list of some or all site variables and values
  variable-set (vset) Set a variable
  version Show drush version
  wrap:table-name (wrap-table-name) Wraps a table name in brackets if a database prefix is being used
ctools    
  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
devel    
  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
devel-generate    
  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
drush-cmi-tools    
  config-export-plus (cexy) Export configuration to a directory and apply an ignore list
  config-import-plus (cimy) Import config from a config directory resepecting live content and a delete list
drush-recipes    
  drush-cook-recipes (cook, c) "cook" up a drush recipe
  drush-diff-targets-recipe (ddt) Analyze two targets and create a recipe to chart a course from one to another. Great for figuring out what a client changed after a distro was installed.
  drush-list-recipes (dlr) List the available recipes and where they are loaded from
  drush-recipe-recorder (dvr) Toggle recording drush commands for a new recipe
  drush-recipes-upgrade (drup) Search for recipes to execute against targets
  drush-recipes-url (drurl) Import recipes from a remote service like drush.recipes
  drush-validate-recipes (valid-recipe) Validate a saved recipe will run if built from scratch
  drush-write-recipe (dwr) Interactive prompt to create a new recipe
ds    
  ds-build Create a basic template and configuration file for a new Display Suite layout
expire    
  expire-comment (xp-comment) Expire a comment by comment ID.
  expire-node (xp-node) Expire a node by node ID
  expire-path (xp-path) Expire a drupal path
  expire-url (xp-url) Expire fully qualified URLs
  expire-user (xp-user) Expire a user by user ID
features    
  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
feeds    
  feeds-clear Delete all items from a feed
  feeds-delete Deletes one or more Feeds importers
  feeds-disable (feeds-dis) Disable one or more Feeds importers
  feeds-enable (feeds-en) Enables one or more Feeds importers
  feeds-import (feeds-im) Imports a feed
  feeds-import-all (feeds-ia, feeds-im-all) Import all instances of feeds of the given type
  feeds-list-feeds (feeds-lf) List all feed sources
  feeds-list-importers (feeds) Get a list of all Feeds importers in the system
  feeds-revert Reverts one or more Feeds importers
field    
  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
filedepot    
  filedepot-libraries Downloads the filedepot 3rd party javascript libraries
hacked    
  hacked-details (hd) Show the Hacked! report about a specific project
  hacked-diff Output a unified diff of the project specified
  hacked-list-projects (hlp) List all projects that can be analysed by Hacked!
  hacked-lock-modified Lock all projects that Hacked! detects are modified, so that drush pm-updatecode will not touch them. (drush-4(dot)x+ only)
httprl-spider    
  httprl-self-request (hsr) Perform a self request from command-line
  httprl-self-spider (hss) Load all entities with web-based urls and hit them to prime the cache. Also allows for developer alters for non entity paths
imageinfo-cache    
  image-generate Generate all derived images for a given field and style
make    
  make Turns a makefile into a working Drupal codebase
  make-convert Convert a legacy makefile into another format. Defaults to converting (dot)make => (dot)make(dot)yml
  make-generate (generate-makefile) Generate a makefile from the current Drupal site
  make-lock Process a makefile and outputs an equivalent makefile with projects version *resolved*. Respects pinned versions
  make-update Process a makefile and outputs an equivalent makefile with projects version resolved to latest available
metatag-importer    
  metatag-convert-page-title Convert data from Page Title into Metatag
migrate    
  migrate-analyze (maz) Analyze the source fields for a migration
  migrate-audit (ma) View information on problems in a migration
  migrate-auto-register (mar) Register any newly defined migration classes
  migrate-deregister Remove all tracking of a migration
  migrate-fields-destination (mfd) List the fields available for mapping in a destination
  migrate-fields-source (mfs) List the fields available for mapping from a source
  migrate-import (mi) Perform one or more migration processes
  migrate-mappings (mm) View information on all field mappings in a migration
  migrate-messages (mmsg) View any messages associated with a migration
  migrate-register (mreg) Register or reregister any statically defined migrations
  migrate-reset-status (mrs) Reset a active migration's status to idle
  migrate-rollback (mr) Roll back the destination objects from a given migration
  migrate-status (ms) List all migrations with current status
  migrate-stop (mst) Stop an active migration operation
  migrate-wipe (mw) Delete all nodes from specified content types
modernizr    
  modernizr-build (mcb) Requests a custom build of Modernizr based on your Drupal module settings. Depends on node(dot)js/npm
  modernizr-dev (mdl) This command used to download a development copy of Modernizr but it is no longer offered on modernizr(dot)com as of v3
module-builder    
  mb-analyze (mban) List the hooks found in a given module
  mb-build (mb) Generate the code for a new Drupal module, including file headers and hook implementations
  mb-component (mbc) Generate a Drupal component, such as a module or profile
  mb-debug Debug module builder. Does whatever was needed at the time
  mb-dir Print the location of the module builder data directory
  mb-dochooks Adds comment headers to hooks that need them in the given module
  mb-docparams Adds params. WIP!
  mb-download (mbdl) Update module_builder hook data
  mb-list List the hooks module_builder knows about
  mb-theme (mbt) Generate template files for a Drupal theme. EXPERIMENTAL
pm    
  pm-disable (dis) Disable one or more extensions (modules or themes)
  pm-download (dl) Download projects from drupal(dot)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-projectinfo (pmpi) Show a report of available projects and their extensions
  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 (pmu) Uninstall one or more modules and their dependent 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
  pm-updatestatus (ups) Show a report of available minor updates to Drupal core and contrib projects
registry-rebuild    
  registry-rebuild (rr) Rebuild the registry table (for classes) and the system table (for module locations) in a Drupal install
relation    
  relation-generate (genrel) Generates relations
role    
  role-add-perm (rap) Grant specified permission(s) to a role
  role-create (rcrt) Create a new role
  role-delete (rdel) Delete a role
  role-list (rls) Display a list of all roles defined on the system. If a role name is provided as an argument, then all of the permissions of that role will be listed. If a permission name is provided as an option, then all of the roles that have been granted that permission will be listed.
  role-remove-perm (rmp) Remove specified permission(s) from a role
rules    
  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    
  rules-scheduler-tasks (rusch) Checks for scheduled tasks to be added to the queue
runserver    
  runserver (rs) Runs PHP's built-in http server for development
search    
  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
search-api    
  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
site-audit    
  audit-all (aa) Executes every Site Audit Report
  audit-best-practices (abp) Audit best practices used
  audit-block (ab) Audit Block
  audit-cache (ac) Audit Drupal's caching settings
  audit-codebase (acb) Audit the codebase
  audit-content (acn) Audit content
  audit-cron (acr) Audit cron
  audit-database Report information about a site environment's database
  audit-extensions (ae) Audit extensions (modules and themes)
  audit-front-end (afe) Analyze a site's front end performance
  audit-insights (agi) Analyze a site using Google PageSpeed Insights
  audit-roles (ar) Audit Roles
  audit-security (asec) Audit the site for known security vulnerabilities
  audit-status (as) Audit Drupal's built-in status report
  audit-users (au) Audit Users
  audit-views (av) Audit Views
  audit-watchdog (aw) Audit the database logs
  site-audit-version Show the Site Audit version
sql    
  sql-cli (sqlc) Open a SQL command-line interface using Drupal's credentials
  sql-connect A string for connecting to the DB
  sql-create Create a database
  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 a database
  sql-sync Copies the database contents from a source site to a target site. Transfers the database dump via rsync
state    
  state-delete (sdel) Delete a state value
  state-get (sget) Display a state value
  state-set (sset) Set a state value
user    
  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)
views    
  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
watchdog    
  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
webform    
  webform-clear Clear a webform by deleting all its submissions
  webform-export (wfx) Exports webform data to a file
xmlsitemap    
  xmlsitemap-index Process un-indexed XML sitemap links
  xmlsitemap-queue-rebuild Dump and queues all possible XML sitemap data to be re-processed via the xmlsitemap_link_process queue. This command does not regenerate the sitemap files
  xmlsitemap-rebuild Dump and re-process all possible XML sitemap data, and then regenerate the files
  xmlsitemap-regenerate Regenerate the XML sitemap files
acapi (Acquia)    
  ac-api-login Store Acquia Cloud API credentials and configuration information
  ac-code-deploy Deploy code from one site environment to another
  ac-code-path-deploy Deploy a specific branch or tag in an environment
  ac-database-add Add a database
  ac-database-copy Copy a database from one site environment to another
  ac-database-delete Delete a database
  ac-database-info Show information about a site database
  ac-database-instance-backup Create a database instance backup
  ac-database-instance-backup-delete Delete a database instance backup
  ac-database-instance-backup-download Download a site environment database instance backup
  ac-database-instance-backup-info Show information about a site environment's database instance backup
  ac-database-instance-backup-list List a site environment's database instance backups
  ac-database-instance-backup-restore Restore a database instance backup
  ac-database-instance-info Show information about a site environment's database instance
  ac-database-instance-list List a site environment's database instances
  ac-database-list List a site's databases
  ac-domain-add Add a domain name to an environment
  ac-domain-delete Delete a domain name from an environment
  ac-domain-info Show information about a site domain
  ac-domain-list List a site's domains
  ac-domain-move Move a domain from one site environment to another
  ac-domain-purge Purge a domain from the Varnish cache
  ac-environment-info Show information about a site environment
  ac-environment-install Install a Drupal distribution from a pre-selected list, URL, or Drush Makefile
  ac-environment-list List a site's environments
  ac-environment-livedev Configure Live Development on a site environment
  ac-files-copy Copy user-uploaded files from one site environment to another
  ac-server-info Show information about a server
  ac-server-list List servers for a site and environment
  ac-server-php-procs Calculate the php max procs value based on possible memory limits and apc shm settings
  ac-site-info Show information about a site
  ac-site-list List all sites available to the current user
  ac-sshkey-add Add an SSH key to a site
  ac-sshkey-delete Delete an SSH key from a site
  ac-sshkey-info Show information about a site SSH key
  ac-sshkey-list List a site's SSH keys
  ac-svnuser-add Add an SVN user to a site
  ac-svnuser-delete Delete an SVN user from a site
  ac-svnuser-info Show information about a site SVN user
  ac-svnuser-list List a site's SVN users
  ac-task-info Show information about a site task
  ac-task-list List a site's tasks
  acquia-update Retrieve Drush aliases for all accessible Acquia Cloud sites
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 Flush all derived images for a given style.
php-eval (eval, ev) 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-runupdatedb (updb) Run tests. Note that you must use the --uri option. 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.
Field commands: (field)
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)
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)
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)
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).

You can also download a detailed information about these Drush commands from site here

Comments

Hey, I am vіsit this sіte on a regular basis, this web site is actually fastidiоus and the users are actually sharing nice thoughts.

It's like you read my mind ! You appear to know so much about this, like you wrote the book in it or something. I think that you can do with a few pics to drive the message home a little bit, but other than that, this is great blog. Keep it up !!

Add new comment