0

Running drush pm-list gives the modules and theme list through some fields. By default, it gives me the Package, Name, Status and Version. I am trying to make a shell script that outputs only module and status to be consumed by other scrips, and things will be much easier if the drush pm-list shows only Name and Status.

Is there a way to prints only the information about the Name and Status from the drush pm-list and omits the Package and Version information?

1 Answer 1

2

Using Drush 8 or Drush 9:

drush pm-list --fields=Name,Status

If you want to consume the output from another script, you might also want to consider:

drush pm-list --format=json

In that instance, all fields will appear in the output; however, since the output will be in json, it is easy to parse and then use only the fields of interest.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.