• VMware

    Learn about VMware virtualization for its products like vsphere ESX and ESXi, vCenter Server, VMware View, VMware P2V and many more

  • Linux

    Step by step configuration tutorials for many of the Linux services like DNS, DHCP, FTP, Samba4 etc including many tips and tricks in Red Hat Linux.

  • Database

    Learn installation and configuration of databases like Oracle, My SQL, Postgresql, etc including many other related tutorials in Linux.

  • How to find/view all the members of a group in Linux

    Now in Linux we have two types of groups
    • Primary Group
    • Secondary Group

    View all the members of the primary group

    First you need to know the GID of the group of whoose members you want to query for

    # grep "group_name" /etc/group
    # grep dba /etc/group

    Now grep that GID to get list of users under dba group
    # grep 503 /etc/passwd

    View all the members of the secondary group

    To do this we have a no. of methods

    Method 1
    # getent group dba

    Method 2
    # grep dba /etc/group

    Method 3
    # groupmems -g "group_name" -l
    # groupmems -g dba -l
    deepak  deep  user  user1

    Deepak Prasad

    is a techie and an author who is still trying to survive in this IT generation with very little knowledge he has on Linux/Unix, VMware, SAN Storage, Automation, networking etc

    You can follow him on Facebook or Google+

    Do you also have something to share here?
    Join GoLinuxHub Team as an Author, Click here for more information
    How to find/view all the members of a group in Linux How to find/view all the members of a group in Linux Reviewed by Deepak Prasad on Monday, April 14, 2014 Rating: 5

    No comments:

    Powered by Blogger.