10

How to print list of users and groups on FreeBSD?

HopelessN00b
  • 53,795
  • 33
  • 135
  • 209
Eonil
  • 10,459
  • 16
  • 36
  • 54

1 Answers1

22

users and groups stored in /etc/group and /etc/passwd. To print:

awk -F":" '{print $1}' /etc/passwd
awk -F":" '{print $1}' /etc/group

for more details

awk -F":" '{print $0 $1 $2}' /etc/passwd
ooshro
  • 11,134
  • 1
  • 32
  • 31
  • 2
    On FreeBSD you get some comment lines in the beginning. Add | grep -v "^#" to delete those from output. – blablabla Dec 19 '15 at 13:45