List the number of members in all Mailman lists

Here’s a little bash script to display the name of all lists in your mailman site and the number of subscribers for each list, just run it in the same directory as your mailman binaries (/usr/lib/mailman/bin on Debian):

#!/bin/bash
LISTS=$((`./list_lists | wc -l` - 1))
LISTS=`./list_lists | tail -n$LISTS | awk '{ print $1 }'`
for i in $LISTS; do
    echo $i `./list_members $i | wc -l`
done

Protip: you can also just copy and paste the lines into your terminal so you don’t have to save it as a script.

Comments

These are imported from this site's old blogging software and are kept for archival reasons.

I just realised that if the Mailman binaries are in your $PATH then you can remove the ‘./’es in the script and it should work from anywhere. #duh