Important Drush commands

Drush is an awesome shell/command line interface for managing Drupal from command line tool(therminal). It helps to perform various admin tasks useing 1 or 2 commands in therminal.

In this tutorial we go through some very basic but important Drush commands.

At first, we have to go our Drupal folder directory:

cd /var/www/[drupal_folder_name]

Some General Drush Commands:

Drush command for overview of installed Drupal site:

drush status

Above command gives an overview of our Drupal site as display on following figure.

drush status

Drush command to clear cache:

drush cc all

Above command clear all cache of Drupal site. if you did not want to clear all cache try following command.

drush cc

drush cc

Drush command to download/enable drupal module:

drush dl views

Above command download views module.

drush en views

Above command enable views module.

Drush command for managing user accounts:

Create a new use:

drush user-create username --mail="email@example.com" --password="password"

Example:

drush user-create test_user --mail="test_user@example.com" --password="1"

 drush user-create

Cancel user account:

drush user-cancel test_user

Example:

drush user-cancel test_user

 drush user-cancel

Change user password:

There are 2 commands for that.

drush user-password username --password="password"

OR:

drush upwd username --password="password"

Example:

drush upwd test_user --password="1"

 

Tags