groups's Examples

by using this command we can get groups under that username

groups linux

no username is passed then this command will display group membership for the current user

$ groups

it id of linux group

$ id linux

it gives all the group names 

$ id -ng

by using this we can get the list of all groups 

getent groups

print the first field containg the group name

$getent group| awk -F:  '{print $1}'

cuts the first filed and displays only the group name

$ getent group cut -d: -f1

DevOpsSchool
Typically replies within an hour

DevOpsSchool
Hi there 👋

How can I help you?
×
Chat with Us