4

How to list all users and groups on Linux?

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

T. Zengerink
  • 199
  • 5
  • 13
liuxingruo
  • 191
  • 1
  • 4
  • 10

2 Answers2

8

getent(1)

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

Ignacio Vazquez-Abrams
  • 45,019
  • 5
  • 78
  • 84
0

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

Aaron Digulla
  • 954
  • 1
  • 13
  • 24