Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

groups(1) [osf1 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)

Check Out this Related Man Page

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)
Man Page

14 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

group by in files :-)

My file looks like: X^~^12^d X^~^19^d Y^~^5^d Y^~^10^d Y^~^11^d Z^~^14^d I need a script that will "group by" the first field and Concatenate the values. My output should be: X^~^12,19^d Y^~^5,10,11^d Z^~^14~d Does anyone have any idea ? (10 Replies)
Discussion started by: hellsd
10 Replies

2. AIX

Security user Can't change the groups.

Dears Security users in AIX don’t have permission to change the group of the user thru Smitty Users When they try to change the group of the users to any group they'll get permission denied Security profile in Smitty : User... (10 Replies)
Discussion started by: ITHelper
10 Replies

3. Shell Programming and Scripting

Split these into many ...(/etc/group)!!

Guys Following input line is from /etc/group file.As we know last entry in a line of /etc/group is userlist (all the users belonging to that group). I need to splilt this one line into 3 lines as shown below (3 because userlist has 3 names in it). Input: lp:!:11:root,lp,printq ... (13 Replies)
Discussion started by: ak835
13 Replies

4. Solaris

Removing users from groups

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)
Discussion started by: the_red_dove
11 Replies

5. Shell Programming and Scripting

File processing

bash-2.05$ vi file_read.sh "file_read.sh" 9 lines, 97 characters #!/bin/ksh print "Enter the group name" read gname varA= grep "$gname::" group print $varA This is the scenario: I am trying to get a userid and groupname from user and trying to add the userid to the given group.... (11 Replies)
Discussion started by: mnathan
11 Replies

6. Shell Programming and Scripting

Assign zero to strings that don't appear in block, store result in AWK array

Hi to all, I have this input: <group> <x "2">Group D</x> <x "3">Group B</x> <x "1">Group A</x> </group> <group> <x "1">Group E</x> <x "0">Group B</x> <x "1">Group C</x> </group> <group> ... (11 Replies)
Discussion started by: Ophiuchus
11 Replies

7. UNIX for Dummies Questions & Answers

Help with shell commands

hi!i want to print all registered users(theres a difference for registered users and logged users right?we can print logged users using who command but registered?) in the system,the groups and my current running processes(with the command ps -ef , ok i can get all the running processes in the... (13 Replies)
Discussion started by: strawhatluffy
13 Replies

8. Shell Programming and Scripting

How to pick a group of data using awk/ksh

Hi gurus, I have data coming in as shown below. And in each case, I need to pick the data in the last group as shown below. Data Set 1: DC | 18161621 LA | 15730880 NY | 16143237 DC | 18161621 LA | 17316397 NY | 17915905 DC | 18161621 LA | 17993534 NY | 18161621 DC | 18161621... (11 Replies)
Discussion started by: calredd
11 Replies

9. Shell Programming and Scripting

Sorting group information for accounts

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)
Discussion started by: MaindotC
10 Replies

10. Shell Programming and Scripting

Sed command help (appending)

I need to append a user to the end of a group in the /etc/group file ftp::49:user1,user2... what I want to to add a new user to the group file so that I won't have to open it up and append manually and I can't user "usermod" it fails this user will be coming from a variable (11 Replies)
Discussion started by: slufoot80
11 Replies

11. UNIX for Advanced & Expert Users

Creating groups and users

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)
Discussion started by: Dorothy
12 Replies

12. Shell Programming and Scripting

Regex - Capturing groups

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)
Discussion started by: ysvsr1
10 Replies

13. Solaris

Groups is not visible

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)
Discussion started by: Revathi2089
13 Replies

14. Shell Programming and Scripting

Grouping and counting

Hello, I would like to group/sort a file of records by a particular field and then count how many records belong in that grouping. For example say I have the following data: 1234|"ZZZ"|"Date"|"1"|"Y"|"ABC"|""|AA ABCD|"ZZZ"|"Date"|"1"|"Y"|"ABC"|""|AA EFGH|"ZZZ"|"Date"|"1"|"Y"|"ABC"|""|BB... (14 Replies)
Discussion started by: Nik44
14 Replies