How do you list users in a solaris group | Unix Linux Forums | Solaris

  Go Back    


Solaris The Solaris Operating System, usually known simply as Solaris, is a Unix-based operating system introduced by Sun Microsystems. The Solaris OS is now owned by Oracle.

How do you list users in a solaris group

Solaris


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 09-20-2006
gillbates gillbates is offline
Registered User
 
Join Date: Mar 2002
Last Activity: 20 April 2009, 4:05 PM EDT
Location: DC
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
How do you list users in a solaris group

I need to list all users in a group. This is a large unix site running nis+.
Sponsored Links
    #2  
Old 09-20-2006
reborg's Avatar
reborg reborg is offline Forum Advisor  
Administrator Emeritus
 
Join Date: Mar 2005
Last Activity: 29 March 2012, 7:00 PM EDT
Location: Ireland
Posts: 4,464
Thanks: 0
Thanked 11 Times in 11 Posts

Code:
getent group <goupname>

Sponsored Links
    #3  
Old 09-20-2006
gillbates gillbates is offline
Registered User
 
Join Date: Mar 2002
Last Activity: 20 April 2009, 4:05 PM EDT
Location: DC
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
That worked great. How do you learn this stuff? Thanks
    #4  
Old 09-21-2006
saainaath saainaath is offline
Registered User
 
Join Date: Sep 2006
Last Activity: 25 September 2006, 4:21 AM EDT
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Hey gill , you can go for one more command 'logins' which will show you all the users logged into ur system put a grep for the particular group

#logins | grep `cat /etc/group | grep <groupname> | cut -d ':' -f4 `

check out the syntax once am not sure but you will get all the users of a group logged in your system. Bye..
Sponsored Links
    #5  
Old 09-21-2006
gillbates gillbates is offline
Registered User
 
Join Date: Mar 2002
Last Activity: 20 April 2009, 4:05 PM EDT
Location: DC
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
I needed the list of all users in a group, not just the ones logged in and reborg's response was exactly what I needed. But I tried the logins cmd for grins and found out that root didn't think I should be running that one.
Sponsored Links
    #6  
Old 09-22-2006
grial's Avatar
grial grial is offline Forum Advisor  
El UNIX es como un toro
 
Join Date: Jun 2006
Last Activity: 1 December 2008, 8:39 AM EST
Location: Madrid (Spain)
Posts: 531
Thanks: 0
Thanked 1 Time in 1 Post
This will also work in other UNIX versions:

Code:
grep "^groupname" /etc/group

At least, for local groups...
Sponsored Links
    #7  
Old 09-28-2006
mdhmi mdhmi is offline
Registered User
 
Join Date: Sep 2006
Last Activity: 3 October 2006, 3:44 AM EDT
Location: Detroit, Michigan
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
It's good to know both ways as "getent" is not also available.

saainaath gets the UUOC award.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Script to list primary group of users Aswex Shell Programming and Scripting 8 10-13-2010 06:09 AM
List ALL users in a Unix Group (Primary and Secondary) ckmehta Shell Programming and Scripting 5 05-27-2009 12:32 PM
How to list group members in solaris 9 vr_mari Solaris 7 05-02-2009 07:20 AM
command help, how do i list the users of a group? crabtruck UNIX for Dummies Questions & Answers 3 09-29-2003 05:13 PM



All times are GMT -4. The time now is 04:34 PM.