Hi,
I would like to know how to find our secondary group of user only.
I have used the command id -Gn user1
it is showing both groups of user.
Primary and secondary group.
Hi,
I would like to know how to find our secondary group of user only.
I have used the command id -Gn user1
it is showing both groups of user.
Primary and secondary group.
id -Gn user1 | cut -d' ' -f2-
Or to store it:
[root@ns2 ~]# id -Gn scott
scott users staff
[root@ns2 ~]# G=$(id -Gn scott)
[root@ns2 ~]# G=${G#* }
[root@ns2 ~]# echo $G
users staff
Many Many Thanks Scott for quick response.