In the ramblings of Linux forums I came across this. It is documented as a better alternative to using grep on the /etc/groups file.

getent group | cut -d: -f1