Drush is a free and open-source software command line and scripting interface for Drupal. It is very popular among Drupal developers. Here is a way to check whether your system has Drush installed and identify its version.
Check Drush Version
Open a terminal, change to your Drupal project folder and execute the following command
drush status
It will give you the version of Drupal, Drush and some additional information as well. Here is what I get when I executed the command.
Drupal version : 9.3.5
Site URI : http://default
DB driver : mysql
DB hostname : database
DB port : 3306
DB username : root
DB name : drupal9
PHP binary : /usr/bin/php7.3
PHP config : /etc/php/7.3/cli/php.ini
PHP OS : Linux
Drush script : /var/www/html/Project/drupal9/vendor/drush/drush/drush
Drush version : 10.6.2
Drush temp : /tmp
Drush configs : /var/www/html/Project/drupal9/vendor/drush/drush/drush.
yml
Drupal root : /var/www/html/Project/drupal9
Site path : sites/default
You can also use drush --version to know which version of Drush are you using.
If you do not have Drush, ie you get a command not found error, follow the installation instructions. Before you download/install Drush, check the drush version compatibility matrix to make sure that it is compatible with your system.
You can check the need of Drush in drupal and also some useful Drush commands.
In Drush, we can back up the database as well as the files using a single command.
Please Get in touch with us, if you are looking for a career in Drupal.