how to list groups and users

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
twb
Forum Commoner
Posts: 27
Joined: Thu Jan 06, 2005 4:39 pm

how to list groups and users

Post 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
User avatar
sweatje
Forum Contributor
Posts: 277
Joined: Wed Jun 29, 2005 10:04 pm
Location: Iowa, USA

Post by sweatje »

cat /etc/group
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post 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 ;)
Post Reply