4

How to list all users and groups on Linux?

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

Teun Zengerink
  • 199
  • 5
  • 13
liuxingruo
  • 201
  • 1
  • 5
  • 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,939
  • 6
  • 79
  • 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
  • 974
  • 3
  • 15
  • 25