Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 283
  • Last Modified:

Quick User List Question

Whats an easy way in linux (SuSE 8.2) to list all of the users in a group? From the command line.

For example, all of the users in the 'users' group.

-Umbrae
0
umbrae
Asked:
umbrae
1 Solution
 
NugsolotCommented:
cd /etc
cat groups | less

This will list the groups and the users in them


Hope this Helps
Nugsolot
0
 
NugsolotCommented:
err should just be group not groups
Nug
0
 
umbraeAuthor Commented:
Nope, only lists users if its not their primary group.

-Umbrae
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
ITG-SSNACommented:
cat /etc/group | grep groupname

[root@mail vhosts]# cat /etc/group | grep wheel
wheel:x:10:admin
[root@mail vhosts]#

Regards,

~K Black
Irvine, Ca.
0
 
wesly_chenCommented:
Hi,

   In additional to the secondary group in /etc/group, you can do "awk" on /etc/passwd.
Before this, you need to know the GID of the group (in /etc/group).
Then
# awk -F: '$4==<GID> {print $1}' /etc/passwd
This will print out those primary group match GID.

Wesly
0
 
umbraeAuthor Commented:
Points go to wesly for the most effective way to determine primary group users with a 1-liner.

Very good work!

-Umbrae
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now