Locate Users In A Specific Group
I've got a Linux server with ~200 user accounts on it. At one point accounts were genricly being created and their primary group (GID) was "users". Since I've taken over, I've created appropriate groups for users but my question is, how can I create a file w/ all the users on the system in /etc/passwd who have a primary GID of "users"?
|
grep users /etc/group
|
Woops. There is nothing listed as "users" so I had to grep for the GUI "100" and that worked. Just had to trim out the one UID that was "100".
|
Try this
Code:
getent passwd | grep $(grep user /etc/group | cut -d: -f3) | cut -d: -f1 |
All times are GMT -5. The time now is 11:12 AM. |