Sponsored Content
Full Discussion: group list
Top Forums UNIX for Dummies Questions & Answers group list Post 302536524 by bartus11 on Tuesday 5th of July 2011 04:16:22 PM
Old 07-05-2011
If you want to know which groups your user belongs to, use this:
Code:
/usr/xpg4/bin/id -Gn

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

command help, how do i list the users of a group?

What command allows you to display a list of the userids of all the other users in a group, regardless if they are logged in or not? (3 Replies)
Discussion started by: crabtruck
3 Replies

2. Solaris

How do you list users in a solaris group

I need to list all users in a group. This is a large unix site running nis+. (6 Replies)
Discussion started by: gillbates
6 Replies

3. Shell Programming and Scripting

How to process the user id list in /etc/group?

To all, I need to find a group in /etc/group and if found, I need to list out all the login ids for that group - one login id per line. To find the list of user login ids for group X, I probably will use cat /etc/group|grep ^X:|cut -d: -f4 This will return back a list of comma delimited... (4 Replies)
Discussion started by: april
4 Replies

4. Shell Programming and Scripting

How to get a list of group members?

Is there a command to get a list of group members? Something similar to the groups command, but instead of passing a username and returning groups, you pass it a groupname, and it returns members? It is difficult to do it manually because the group membership information is split across two... (5 Replies)
Discussion started by: akbar
5 Replies

5. Solaris

How to list group members in solaris 9

Hi, I already gone through with old post regarding listing the group members and tried the command getenv group other the result is other::1:root i listed my part of the /etc/passwd file below test1:x:100:1::/home/test1:/bin/sh test2:x:101:1::/home/test2:/bin/ksh... (7 Replies)
Discussion started by: vr_mari
7 Replies

6. Shell Programming and Scripting

List ALL users in a Unix Group (Primary and Secondary)

Is there a command or better combination of cmds that will give me the list of Unix users in a particular Unix group whether their primary group is that group in question (information stored in /etc/passwd) or they are in a secondary group (information stored in /etc/group). So far all I got... (5 Replies)
Discussion started by: ckmehta
5 Replies

7. Shell Programming and Scripting

Script to list primary group of users

Dear All I am facing a problem with my script. I have to found the primary group of users . So first I selected all the groups and users register from a specific user : ONE Then I am making a file with all groups attached to the user : ONE Then I am making a file with all... (8 Replies)
Discussion started by: Aswex
8 Replies

8. UNIX for Dummies Questions & Answers

Where can I find a list of POSIX certificated OS by open group?

Linux is said to be POSIX compliant but can't be named UNIX while Solaris, AIX, HP-UX are named UNIX. Where can I get a list of certificated UNIX? I can't find it in opengroup.org (1 Reply)
Discussion started by: vistastar
1 Replies

9. Shell Programming and Scripting

Script to check if list of files belong to particular group

i just need help to write a shell script which when run should take the text doc(contains list of files which are to be copied) as input and then each file has to be checked to see if they belong to any of the 5 groupnames that we are going to mention in the other list document, id they belong to... (1 Reply)
Discussion started by: draghun9
1 Replies

10. Shell Programming and Scripting

List files whose owner or group is numeric

I want to add a condition is my find command to include files/sub-directory whose owner or group is all numeric number. My current find command is find . \( -user root -o -user soham\) -type f -exec ls -l {} \; 2>&1 ---------- Post updated at 10:20 AM ---------- Previous update was at... (5 Replies)
Discussion started by: Soham
5 Replies
id(1M)							  System Administration Commands						    id(1M)

NAME
id - return user identity SYNOPSIS
/usr/bin/id [-p] [user] /usr/bin/id -a [-p] [user] /usr/bin/id -G [-n] [user] /usr/bin/id -g [-nr] [user] /usr/bin/id -u [-nr] [user] /usr/xpg4/bin/id [-p] [user] /usr/xpg4/bin/id -a [-p] [user] /usr/xpg4/bin/id -G [-n] [user] /usr/xpg4/bin/id -g [-nr] [user] /usr/xpg4/bin/id -u [-nr] [user] DESCRIPTION
If no user operand is provided, the id utility writes the user and group IDs and the corresponding user and group names of the invoking process to standard output. If the effective and real IDs do not match, both are written. If multiple groups are supported by the underly- ing system, /usr/xpg4/bin/id also writes the supplementary group affiliations of the invoking process. If a user operand is provided and the process has the appropriate privileges, the user and group IDs of the selected user are written. In this case, effective IDs are assumed to be identical to real IDs. If the selected user has more than one allowable group membership listed in the group database, /usr/xpg4/bin/id writes them in the same manner as the supplementary groups described in the preceding paragraph. Formats The following formats are used when the LC_MESSAGES locale category specifies the "C" locale. In other locales, the strings uid, gid, euid, egid, and groups may be replaced with more appropriate strings corresponding to the locale. "uid=%u(%s) gid=%u(%s) " <real user ID>, <user-name>, <real group ID>, <group-name> If the effective and real user IDs do not match, the following are inserted immediately before the character in the previous format: " euid=%u(%s)" with the following arguments added at the end of the argument list: <effective user ID>, <effective user-name> If the effective and real group IDs do not match, the following is inserted directly before the character in the format string (and after any addition resulting from the effective and real user IDs not matching): " egid=%u(%s)" with the following arguments added at the end of the argument list: <effectivegroup-ID>, <effectivegroupname> If the process has supplementary group affiliations or the selected user is allowed to belong to multiple groups, the first is added directly before the NEWLINE character in the format string: " groups=%u(%s)" with the following arguments added at the end of the argument list: <supplementary group ID>, <supplementary group name> and the necessary number of the following added after that for any remaining supplementary group IDs: ",%u(%s)" and the necessary number of the following arguments added at the end of the argument list: <supplementary group ID>, <supplementary group name> If any of the user ID, group ID, effective user ID, effective group ID or supplementary/multiple group IDs cannot be mapped by the system into printable user or group names, the corresponding (%s) and name argument is omitted from the corresponding format string. When any of the options are specified, the output format is as described under OPTIONS. OPTIONS
The following options are supported by both /usr/bin/id and /usr/xpg4/bin/id. The -p and -a options are invalid if specified with any of the -G, -g, or -u options. -p Reports additionally the current project membership of the invoking process. The project is reported using the format: "projid=%u(%s)" which is inserted prior to the 0fR character of the default format described in the Formats section. The arguments <project ID>,<project name> are appended to the end of the argument list. If the project ID cannot be mapped by the system into a printable project name, the corresponding (%s) and name argument is omitted from the corresponding format string. -a Reports user name, user ID and all the groups to which the user belongs. -G Outputs all different group IDs (effective, real and supplementary) only, using the format "%u ". If there is more than one distinct group affiliation, output each such affiliation, using the format " %u", before the NEWLINE character is output. -g Outputs only the effective group ID, using the format "%u ". -n Outputs the name in the format "%s" instead of the numeric ID using the format "%u". -r Outputs the real ID instead of the effective ID. -u Outputs only the effective user ID, using the format "%u ". OPERANDS
The following operand is supported: user The user (login) name for which information is to be written. ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of id: LANG, LC_ALL, LC_CTYPE, LC_MES- SAGES, and NLSPATH. EXIT STATUS
The following exit values are returned: 0 Successful completion. >0 An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: /usr/bin/id +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu, SUNWcar | +-----------------------------+-----------------------------+ |Interface Stability |Stable | +-----------------------------+-----------------------------+ /usr/xpg4/bin/id +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWxcu4 | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ SEE ALSO
fold(1), logname(1), who(1), getgid(2), getgroups(2), getprojid(2), getuid(2), attributes(5), environ(5), standards(5) NOTES
Output produced by the -G option and by the default case could potentially produce very long lines on systems that support large numbers of supplementary groups. SunOS 5.11 28 Nov 2006 id(1M)
All times are GMT -4. The time now is 03:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy