groups(1) User Commands groups(1)NAME
groups - print group membership of user
SYNOPSIS
groups [user]...
DESCRIPTION
The command groups prints on standard output the groups to which you or the optionally specified user belong. Each user belongs to a group
specified in /etc/passwd and possibly to other groups as specified in /etc/group. Note that /etc/passwd specifies the numerical ID (gid)
of the group. The groups command converts gid to the group name in the output.
EXAMPLES
The output takes the following form:
example% groups tester01 tester02
tester01 : staff
tester02 : staff
example%
FILES
/etc/passwd
/etc/group
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO group(4), passwd(4), attributes(5)SunOS 5.11 14 Sep 1992 groups(1)
Check Out this Related Man Page
groups(1) General Commands Manual groups(1)NAME
groups - Displays your group membership
SYNOPSIS
groups [user]
DESCRIPTION
The groups command writes to standard output the groups to which you or the specified user belong. The Tru64 UNIX operating system allows
a user to belong to many different groups at the same time.
Your primary group is specified in the /etc/passwd file. Once you are logged in, you can change your active group with the newgrp shell
command (see sh). When you create a file, its group ID is that of your active group.
Other groups that you belong to are specified in the /etc/group file. If you belong to more than one group, you can access files belonging
to any of those groups without changing your primary group ID. These are called your concurrent groups.
NOTES
The /etc/passwd and /etc/group files must be on the same node.
EXAMPLES
To determine your group membership, enter: groups
The groups to which you belong will be displayed. For example: devel prod
FILES
Contains group information. Contains user information.
SEE ALSO
Commands: csh(1), ksh(1), sh(1)
Functions: initgroups(3), setgroups(2)groups(1)
I have a script that puts out a list that looks like this:
bb1 newyork
bb1 pittsburg
bb2 seattle
bb2 spokane
sl1 sacramento
I want to seperate the output so that it instead has a space between each group so like this:
bb1 newyork
bb1 pittsburg
bb2 seattle
bb2 spokane
sl1... (8 Replies)
My users and groups have gotten out of control on a lot of my servers. Is their some tool out there that can give me a report on;
1. users
2. what groups they are assigned to
3. comment field
4. last login
Something that can pull all this into a nice graphical page for the bosses to look... (7 Replies)
Hello gurus,
I've been working on a sudoers file to work with groups in LDAP. I've created the groups in LDAP and added the users to there respective groups. I've also setup my sudoers file to have the groups match what is in LDAP. And I've added ldap to nsswitch.conf in the group line. The... (6 Replies)
How do I remove a user from a group? I'm using the usermod command but its not working.
I have a user "abc" who is a member of the groups root and other. I'm trying to remove him from the group "other" (using CLI) which is his secondary group but it's not working.
How do I do this? Is there any... (11 Replies)
Experts,
I know when I use id it shows only the primary group information for the given user, and that info comes from passwd file. When I use groups it shows all groups user are member of, however from where come information given by groups command?
grep fmtt3990 /etc/passwd... (6 Replies)
ISBN 10:
it has 4 groups separated with ' ' or '-'
1. group need to has 1-5 digits
2. group need to has max 7
3. max 6
4. 1 digit or letter 'X'
ISBN 13
5 groups separated with ' ' or '-'
1. group - always has 3 digits
2. group same as 1st in isbn10
3. group same as 2nd in isbn10
4.... (6 Replies)
(Solved)I have a test id: testuser, when I create it pgrp=testgrp groups=testgrp, staff, I check it by lsuser testuser later, it shows pgrp=testgrp, groups=testgrp, no staff in groups, how to add staff in groups? (6 Replies)
I'm looking to parse the output of the id command.
uid=205(oracle) gid=203(dba) groups=4(adm),207(oinstall),202(ndm),206(eis)
Is there an easy way I can get the user name (in this case "oracle) using a sed or awk command. The username will always be inside the parenthsis
and proceeded... (7 Replies)
I have an input file that contains the primary and secondary groups a user should have based on a pre-defined role. The input file looks like this:
<user_login>|<comment_field>|<role>
After I execute my script to do some grepping I have the following user file where the secondary groups are... (10 Replies)
Hi
Could anyone please suggest how we can check in Linux if a user or a group name is already existing? In case of a user the command should also be able to specify the user with a given directory and shell. We can of course check this using a grep command but since that is just a pattern match,... (12 Replies)
Hi All,
I have to do one simple script in AWK. I must to show all users in the group and the group name is called from the keyboard.
I know that I can get groups etc. from /etc/group file.
#!/bin/bash
echo "Group name: "
read name
awk '{split($0,array,":")} {if(array ==... (6 Replies)
I am having trouble with regex capturing groups, For Ex :
I am having a file with
ABC CDLF SFSDFK PRIMARY INDEX(XYZ,DEF,GHI);
XYZ FLJ SDFKLD; PRIMARY INDEX(ABC);
BHI SDKFLFLSFD PRIMARY INDEX (QWE , RTY , LHJ);
My output should be :
ABC XYZ,DEF,GHI
XYZ ABC
BHI ... (10 Replies)
Please consider the following file, I have many groups which can be of 3 types, T1 (Serial_Number 1) T2 (Serial_Number 2) and T1*T2 (all other Serial_Number).
I want to only consider groups that have both T1 and T2 present and their values are different from each other. In the example file,... (8 Replies)
OS : SunOS 5.8
I am trying to add a user ad3059 to the following groups,
A B C D ( four groups A,B,C,D)
When i use usermod command and add the user to the above groups,
and go to
> groups ad3059
other C D
It doesnt show A and B groups and shows it as other.Please advice on how... (13 Replies)