LinuxCommandLibrary

drush

command-line shell for Drupal

TLDR

Clear all caches

$ drush cache:rebuild
copy
Download and install module
$ drush pm:install [module_name]
copy
Update database
$ drush updatedb
copy
Run cron
$ drush cron
copy
Show site status
$ drush status
copy
Export configuration
$ drush config:export
copy
Import configuration
$ drush config:import
copy
Generate one-time login link
$ drush user:login
copy

SYNOPSIS

drush command [options] [arguments]

DESCRIPTION

Drush (Drupal Shell) is the command-line interface for Drupal, providing tools for site administration, development, and deployment. It's essential for Drupal developers and administrators.
The tool handles cache clearing, module management, database updates, configuration synchronization, and user administration. Short aliases (cr, cex, cim) provide quick access to common commands.
Drush supports site aliases for managing multiple Drupal sites and integrates with deployment workflows for configuration management.

PARAMETERS

COMMAND

Drush command to execute.
cache:rebuild, cr
Clear all caches.
pm:install NAME
Install module.
updatedb, updb
Apply database updates.
config:export, cex
Export configuration.
config:import, cim
Import configuration.
user:login, uli
Generate login link.
status, st
Show site information.
--help
Display help information.

CONFIGURATION

~/.drush/drushrc.php or ~/.drush/drush.yml

User-level Drush configuration for default options and aliases.
drush/drush.yml or drush/sites/.yml
Project-specific Drush configuration files in Drupal root.
**/drush/sites/*.site.yml**
Site alias definitions for managing multiple Drupal sites.

CAVEATS

Requires Drupal installation. Must run from site root or use aliases. Version must match Drupal version. Some commands need database access.

HISTORY

Drush was created by Moshe Weitzman and others in 2007 for Drupal 5. It has evolved alongside Drupal, becoming the standard CLI tool for Drupal administration and development.

SEE ALSO

drupal(1), composer(1), php(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community