No Drupal Developer needs introduction about Drush. The power and features of Drush has made the job easier for many developers. Drush by default has a list of commands that we can make use of, the entire list can be seen here. But apart from that, the Drush does has the feature to allow custom commands.
These custom commands can be used as per our need and scenarios. In my case, I had the need to list the users in site using a Drush command. To create a custom Drush command we need to create a custom module and then create a new file in the module - [module-name].drush.inc. We will make use of the hook_drush_command to create a new drush command.
Now go to the command line and run the below command to list the users present in the drupal site.
The custom drush command can be used in any kind of scenarios. Forget not to enable the module, before using the custom Drush command.
Quick solution for create own drush commands.