Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to list all users and groups on Linux?

And what's the difference between user:root and user:othergroup?

share|improve this question
up vote 8 down vote accepted


user:root is a combination of user user and group root. user:othergroup is a combination of user user and group othergroup.

share|improve this answer

From the commandline, simply look at the files /etc/passwd and /etc/group. The information you look for is in the first column.

share|improve this answer
This will fail if something like LDAP is being used. – Ignacio Vazquez-Abrams May 10 '10 at 7:32
Worse, this will appear to work but will fail to show any accounts or groups that are not present in those files. – bignose May 10 '10 at 8:10
Agreed :-) I'm starting to feel my age ;-) – Aaron Digulla May 12 '10 at 20:54
If you have LDAP, looking at those files will not get all groups, on those cases, command "getent group" will. – kpraes Jan 14 '14 at 15:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.