Drupal - How to get list of installed/enabled modules ready for repopulating new site with drush module installation?
drush pm-list --status="enabled" --pipe
--status="enabled"
Filter by extension status. Choices:enabled
,disabled
and/or 'not installed
'. You can use multiple comma separated values. (i.e.--status="disabled,not installed"
).
--pipe
Equivalent to--format=list
.
--format="list"
Select output format. Available:table
,csv
,json
,list
,var_export
,yaml
. Default istable
.
Ok, got it working, commands to use are:
drush pm-list --type=module --status=enabled --no-core --format=list
and then you can use the:
edit>>mark>>copy
from drush console.
If the purpose of your question is to repopulate a new site (as in your question title), then you may want to look at the drush make-generate command.
No need for things like editing and/or running macros (though you could edit the result if for whatever reason you still have to do so).
Refer to How to use Drush Make in your daily routine for an interesting article about it also.