How to install Drush

Drush is an awesome shell interface for managing Drupal right from your server command line. It is a very useful tool as it helps you perform various admin tasks using just one or two commands in the terminal

Find your appropriated Drush version for your Drupal

mv drush-master/ drush/
chmod u+x drush/drush
echo "alias drush='~/drush/drush'" >> ~/.bashrc
echo "alias composer='~/drush/composer.phar'" >> ~/.bashrc 
source ~/.bashrc

Test how it works

drush core-status

Installing Composer if required

cd drush
curl -sS | php
php composer.phar install

Some useful commands:

drush help
drush pm-update
drush sql-dump --result-file=database_name.sql
drush cc
drush cc all
drush cache-rebuild
drush pm-list

To update only Drupal core:

drush up drupal

List of enabled modules:

drush pm-list --type=Module --status=enabled
drush pm-list --type=Module --no-core --status=enabled

Check if updates available:

drush ups

To update only the module Views:

drush up views

To update Views, Token and Rules modules:

drush up views token rules

To update all contrib modules but not the Drupal core:

drush up --no-core

DB update

drush updatedb

One time login link

drush user-login admin

Similar Posts:

Leave a Reply

Your email address will not be published. Required fields are marked *