Unix/Linux Go Back    


Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here!

members in a group

Linux


Closed Linux or Unix Question    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 05-22-2008
arthi arthi is offline
Registered User
 
Join Date: May 2008
Last Activity: 30 January 2009, 7:58 AM EST
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
members in a group

Hi all,
I am new to Linux.Can anyone tell me how to display or list all the members in a group?


Thanks in advance.
Sponsored Links
    #2  
Old Unix and Linux 05-22-2008
nua7 nua7 is offline
Registered User
 
Join Date: Mar 2008
Last Activity: 30 March 2015, 8:23 AM EDT
Location: /bin/sh
Posts: 429
Thanks: 26
Thanked 4 Times in 4 Posts
Look out for the following files:

/etc/passwd and /etc/group

Hope this helps!

nua7
Sponsored Links
    #3  
Old Unix and Linux 05-22-2008
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 27 April 2015, 11:14 AM EDT
Location: NM
Posts: 10,435
Thanks: 328
Thanked 857 Times in 796 Posts
one way, assume we want the group called prog:

Code:
grep '^prog' /etc/group

    #4  
Old Unix and Linux 05-22-2008
oktawik oktawik is offline
Registered User
 
Join Date: Mar 2008
Last Activity: 22 May 2008, 8:14 AM EDT
Posts: 10
Thanks: 0
Thanked 1 Time in 1 Post
Use the command:
# groups

Rgs,
Oktawik
Sponsored Links
    #5  
Old Unix and Linux 05-22-2008
nua7 nua7 is offline
Registered User
 
Join Date: Mar 2008
Last Activity: 30 March 2015, 8:23 AM EDT
Location: /bin/sh
Posts: 429
Thanks: 26
Thanked 4 Times in 4 Posts
groups will simply list out the groups avalaible on the system. It won't give you the members associated with them.

Grepping on /etc/group with the desired group name would do the trick.
Sponsored Links
    #6  
Old Unix and Linux 05-22-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
 
Join Date: Mar 2008
Last Activity: 28 March 2011, 6:41 AM EDT
Location: /there/is/only/bin/sh
Posts: 3,653
Thanks: 0
Thanked 10 Times in 8 Posts
On my Linux at least, groups era prints which groups I am a member of.
Sponsored Links
    #7  
Old Unix and Linux 05-23-2008
arthi arthi is offline
Registered User
 
Join Date: May 2008
Last Activity: 30 January 2009, 7:58 AM EST
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Thank you all...
Sponsored Links
Closed Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Unix or Linux Image More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to list group members in solaris 9 vr_mari Solaris 7 05-02-2009 06:20 AM
How to allow group members to kill process? The Dark Knight AIX 4 01-03-2009 11:07 AM
How to get a list of group members? akbar Shell Programming and Scripting 5 11-16-2008 07:29 PM
make issue when I add some members into a NIS group on solaris 9,please help !! lk74612 Solaris 4 11-17-2006 04:07 AM
listing members of a unix group ovaska UNIX for Dummies Questions & Answers 2 03-09-2005 04:54 PM



All times are GMT -4. The time now is 07:52 AM.