How to find the user or myself belongs to which group? Because group is important for the folder and device access permissions. One user can be join multiple or single group. We can get our current group membership or another user group membership.
Who Am I?
First when we log in a system we may want to get our username and user account related information.
My Group Memberships
I can get my group membership by using groups command without providing any parameter
- As we expected root user is in the root group
Another User Group Membership
I want to get other user group membership. There is no need for parameter.
test2 : mysql root
- groups will give group membership information of test2
- test2 is the user we want to get group membership
- mysql and root are group names of the test2 joined