Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

id(1) [mojave man page]

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

NAME
id -- return user identity SYNOPSIS
id [user] id -A id -F [user] id -G [-n] [user] id -M 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: -A Display the process audit user ID and other process audit properties, which requires privilege. -F Display the full name of the user. -G Display the different group IDs (effective, real and supplementary) as white-space separated numbers, in no particular order. -M Display the MAC label of the current process. -P Display the id as a password file entry. -a Ignored for compatibility with other id implementations. -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. EXIT STATUS
The id utility exits 0 on success, and >0 if an error occurs. SEE ALSO
who(1) STANDARDS
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
September 26, 2006 BSD

Check Out this Related Man Page

id(1)							      General Commands Manual							     id(1)

NAME
id - print user and group IDs and names SYNOPSIS
[user] [user] [user] DESCRIPTION
The command writes a message to standard output, giving the user and group IDs and names for the process. If the effective and real IDs are different, both are printed. If the process has supplementary group affiliations (see groups(1)), the supplementary group affiliations are also written. If the user operand is specified and the process has 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, then the group membership information is written. Options The following options modify the behavior described above. Display only the group ID. The default is the effective group ID; to modify, use the option. If the process has supplementary group affiliations that are different from the effective group ID (or the real ID if the option is used), display each such affiliation on the same line. The default is decimal format; to modify, use the option. Output 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> is output. With A or display the ID name instead of the ID number. With or display the real ID instead of the effective ID. Display only the user ID. The default is the effective user ID; to modify, use the option. The default is decimal format; to modify, use the option. Displays process resource group ID for the process along with the user and group IDs and names. The option ignores user argument. See HP Process Resource Manager in RETURN VALUE
The error codes returned by are : Success. User not found or invalid options or invalid combination of options. The option is given when PRM is not supported or configured. EXAMPLES
To display the current user and group data: produces: To display the group ID number for the current process: produces: To display the group name for the current process: produces: To display the user and group data for another user: produces: To display the PRM group ID for the current process: produces: DEPENDENCIES
HP Process Resource Manager The option requires that the optional HP Process Resource Manager (PRM) software be installed and configured. See prmconfig(1) for a description of how to configure HP PRM, and prmconf(4) for the definition of the process resource group. AUTHOR
was developed by HP and AT&T. SEE ALSO
groups(1), logname(1), getuid(2). HP Process Resource Manager: prmconfig(1), prmconf(4) in STANDARDS CONFORMANCE
id(1)
Man Page