Page 1 of 1

how to list groups and users

Posted: Sat Oct 08, 2005 8:40 pm
by twb
Hi
Im new to linux. I am using red hat, at the terminal Im looking for the command that lists all the groups and users. I know it is in the /etc/group.
Any help would be helpful

Posted: Sat Oct 08, 2005 9:12 pm
by sweatje
cat /etc/group

Posted: Sat Oct 08, 2005 9:22 pm
by timvw
If your users live in /etc/passwd and groups in /etc/group:

Code: Select all

cut -f1 -d: /etc/passwd
cut -f1 -d: /etc/group
If you have configured pam/nss to use different sources (fe: ldap) you'll need something different ;)