In Drupal development, we spend quite a lot of time on module management.
- Browser: Go to the module page
- Browser: Copy the download link
- Shell: Go to the sites/all/modules directory
- Shell: Download the module using the wget command with the copied link
- Shell: Extract the module by the tar command
- Shell: Remove the extracted archive
- Browser: Login to the Drupal instance and go to the module page
- Browser: Enable the module
A typical Drupal website requires about twenty modules. That means you need to repeat the above tedious steps for twenty times. Besides, you have to move your focus between the browser and the shell prompt.
If you are a command line enthusiast, Drush is the tool you are looking for and all the steps can be done through the shell console.
1. Go to your home folder.
- cd /home/<username>
2. Go to the Drush project page and copy the latest download link. Download it to your home folder.
3. Extract it.
- tar zxf drush-7.x-5.8.tar.gz
4. Edit your own .bashrc and append the following line on it.
/home/<username>/.bashrc
export PATH="$PATH:/home/<username>/drush"
5. Update the change by passing it to the TCL Interpreter.
- source .bashrc
7. Check if it works.
- drush status
8. Go to the Drupal instance webroot and try download a module. For example, admin_menu
- drush dl admin_menu
9. Enable the module you need.
- drush en admin_menu_toolbar
10. Disable the module you don’t need anymore.
- drush dis toolbar
Done =)
Reference:
One thought on “Drush – The command line tool for Drupal development”