Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

groups(1) [netbsd man page]

GROUPS(1)						    BSD General Commands Manual 						 GROUPS(1)

groups -- show group memberships SYNOPSIS
groups [user] DESCRIPTION
The groups utility has been obsoleted by the id(1) utility, and is equivalent to ``id -Gn [user]''. The command ``id -p'' is suggested for normal interactive use. The groups utility displays the groups to which you (or the optionally specified user) belong. The groups utility exits 0 on success, and >0 if an error occurs. SEE ALSO
id(1) BSD
June 6, 1993 BSD

Check Out this Related Man Page

ID(1)							    BSD General Commands Manual 						     ID(1)

id -- return user identity SYNOPSIS
id [user] id -G [-n] [user] id -P [user] id -g [-nr] [user] id -p [user] id -u [-nr] [user] DESCRIPTION
The id utility displays the user and group names and numeric IDs, of the calling process, to the standard output. If the real and effective IDs are different, both are displayed, otherwise only the real ID is displayed. If a user (login name or user ID) is specified, the user and group IDs of that user are displayed. In this case, the real and effective IDs are assumed to be the same. The options are as follows: -G Display the different group IDs (effective, real and supplementary) as white-space separated numbers, in no particular order. -P Display the id as a password file entry. -g Display the effective group ID as a number. -n Display the name of the user or group ID for the -G, -g and -u options instead of the number. If any of the ID numbers cannot be mapped into names, the number will be displayed as usual. -p Make the output human-readable. If the user name returned by getlogin(2) is different from the login name referenced by the user ID, the name returned by getlogin(2) is displayed, preceded by the keyword ``login''. The user ID as a name is displayed, preceded by the keyword ``uid''. If the effective user ID is different from the real user ID, the real user ID is displayed as a name, preceded by the keyword ``euid''. If the effective group ID is different from the real group ID, the real group ID is displayed as a name, preceded by the keyword ``rgid''. The list of groups to which the user belongs is then displayed as names, preceded by the keyword ``groups''. Each display is on a separate line. -r Display the real ID for the -g and -u options instead of the effective ID. -u Display the effective user ID as a number. DIAGNOSTICS
The id utility exits 0 on success, and >0 if an error occurs. SEE ALSO
The id function is expected to conform to IEEE Std 1003.2 (``POSIX.2''). HISTORY
The historic groups(1) command is equivalent to ``id -Gn [user]''. The historic whoami(1) command is equivalent to ``id -un''. The id command appeared in 4.4BSD. BSD
June 6, 1993 BSD
Man Page

15 More Discussions You Might Find Interesting

1. Solaris

Adding new groups!!

I want to know how we can add a new group in solaris. As per my understanding this is done by adding a new entry in /etc/groups file (or by using groupadd command which will also add the entry in the groups file). But when I use group command to see the groups to which I belong, it shows my userid... (7 Replies)
Discussion started by: atheek
7 Replies

2. UNIX for Advanced & Expert Users

How to remove UNIX user and groups

I created UNIX groups - oinstall, dba and UNIX user - oracle for the installation of Oracle 10g. But I might did something incorrectly. Oracle user account didn't created properly. How to remove these UNIX groups and user so that I can start over again to create them properly. Thanks. (7 Replies)
Discussion started by: duke0001
7 Replies

3. UNIX for Dummies Questions & Answers

Assign groups by e-mail

Folks; I want to give a group a read access to a directory tree, but i want the group to be defined by the email account. here's the details: I have a punch users who use e-mail addresses of "*". I want give this group of "*" a read access to a directory tree so every one who... (8 Replies)
Discussion started by: moe2266
8 Replies

4. AIX

Volume Groups and the SAN

Hello all. I have a perplexing problem I have an AIX 5.1 system on an EMC SAN. This system had been on a CX400 SAN for several years. The system was migrated to a CX700 just over a week ago. The migration consisted of utilizing on of the HBAs in the system and connecting to both SANs ... (9 Replies)
Discussion started by: mhenryj
9 Replies

5. Shell Programming and Scripting

Breaking long lines into (characters, newline, space) groups

Hello, I am currently trying to edit an ldif file. The ldif specification states that a newline followed by a space indicates the subsequent line is a continuation of the line. So, in order to search and replace properly and edit the file, I open the file in textwrangler, search for "\r " and... (14 Replies)
Discussion started by: rowie718
14 Replies

6. 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

7. 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

8. 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

9. Shell Programming and Scripting

Frustrating Groups loop

I'm trying to list a bunch of users' groups and filter them out to be space delimited like this: 3610 14 25 2810 Using the "id" command they would look like this: uid=39693(user1) gid=14(dev) groups=3610(a_dev),14(dev) uid-39471(user2) gid=25(testing) groups=2810(prod),25(testing) I want the... (13 Replies)
Discussion started by: MaindotC
13 Replies

10. 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

11. 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

12. Red Hat

NFS share and groups

I am having an issue with getting the proper group settings on NFS-shared directories. NFS server, NFServe, nfs-shares hundreds of project directories...running Solaris 10 latest patches/updates. SAS server, SAServe, statistical analysis server running on RedHat 7 with latest kernel/patches/etc.... (14 Replies)
Discussion started by: cjhilinski
14 Replies

13. Shell Programming and Scripting

Sorting in groups

Hi, I am looking at a slightly different sorting problem and I am not sure how to do it in bash. I have the following input: 0 ... (8 Replies)
Discussion started by: jamie_123
8 Replies

14. 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

15. Shell Programming and Scripting

Script to run #groups command on list in a file

I have to provide a listing of all usernames and group assignments on Linux servers running SLES 12 SP 3. I am trying to automate this via a #for loop. It is not doing as desired and could use a little assistance. Here is the code: #!/bin/bash for uname in 'cat $(hostname)_unlist.txt' do... (8 Replies)
Discussion started by: Kentlee65
8 Replies