Create a shortcut for drush | Drupal 8

Create a shortcut for drush

Submitted by editor on Thu, 01/21/2021 - 11:23
Question

Different possibilities to run drush (drush 10)

Method 1 : Install and run drush as described in this article
This is the recommended method

Method 2 : Create a shortcut on ~/.local/bin

1. Create a link to drush exec file on ~/.local/bin
Example:
cd ~/.local/bin
ln -s 'PATH TO DRUSH BIN'
Example:
ln -s /home/drupal/.config/composer/vendor/bin/drush

2. If not added yet, add ~/.local/bin folder to env path (Tutorial) to load automaticly or load manually like
PATH=$PATH:$HOME/.local/bin:$HOME/bin
export PATH

Methos 3 : Create shorcut on .bashrc
Edit ~.bashrc file and add (For example)
alias drush='PATH TO DRUSH BIN'
Example:
alias drush='/home/drupal/.config/composer/vendor/bin/drush'

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.