Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.5: View the full users and groups list' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.5: View the full users and groups list
Authored by: jctull on Nov 02, '07 08:47:27AM
I wanted a list of just the group id's the other day. This command will produce a list in the Terminal, assuming you are using the bash shell. You can substitute the grep keyword, PrimaryGroupID, to get other information, like group names, etc. There is probably a more elegant way to do this, but this worked for me.
for i in $(dscl . list /Groups) ; do dscl . read /Groups/$i | grep PrimaryGroupID ; done


[ Reply to This | # ]
10.5: View the full users and groups list
Authored by: jctull on Nov 02, '07 08:49:04AM
It looks like the same can be done with:
 dscacheutil -q group | grep gid: 


[ Reply to This | # ]