list all unix accounts and groups on a system

Could someone please provide me with the syntax for retrieving all unix accounts and groups on a system? - Thanks!
sikyalaSenior Database AdministratorAsked:
Who is Participating?
 
arthurjbCommented:
This really depends on how the accounts are being stored.

If you are using just the files the command is;  
cat /etc/passwd
cat /etc/group


If you are using nis then the command is;    
ypcat passwd
ypcat group

If you are using nis+ then the command is;  
niscat passwd.org_dir
niscat group.org_dir

Many systems use a combination of storage methods, so a machine may have accounts using both files and nis or nis+.
0
 
sikyalaSenior Database AdministratorAuthor Commented:
This worked great. Thanks!

If you are using just the files the command is;  
cat /etc/passwd
cat /etc/group
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.