Invoking id without arguments displays the user name and group affiliations of the person who issues the command. Specifying a user argument on the command line displays the same information for the given user instead of the person invoking id. In this case, you require appropriate permissions (on POSIX-conforming systems).
The output has the format
where runum is the user's real user ID number, username is the user's real user name, rgnum is the user's real group ID number, and groupname is the user's real group name.
On POSIX-conforming systems, a user's real and effective IDs may differ. In this case, there may be separate entries for effective user ID with the format
where eunum is the effective user ID number and euname is the effective user name. An entry for effective group ID has the format
where egnum is the effective group ID number and egname is the effective group name.
- displays all different group IDs (effective, real and supplementary) as numbers separated by spaces.
- displays only the effective group ID number.
-G, -g, or -u, displays the name rather than number. -r
-gor -u, displays the real ID rather than the effective one. -u
- displays only the effective user ID number.
On 7/2008R2/8/2012/10/2016, if the security enhancements are enabled (see security) then the userID name is only matched against user account names in the SAM database. Further, using numeric userIDs is not recommended since these numbers are now indexes into an internal PTC MKS Toolkit table which is not useful for the user. If the security enhancements are disabled, the userID names, gids, and numbers are obtained from the files $ROOTDIR/etc/passwd and $ROOTDIR/etc/group.
When set, MKS Toolkit uses local security information. This variable overrides TK_NTSECURITYINFO_OFF. Internally, id sets and exports this variable (and unsets it when it is done) to enable id [local_user] to work properly.
On UNIX and POSIX-conforming systems, this contains the group affiliations of each user. On Windows systems, id uses the ROOTDIR variable to find the /etc directory.
On UNIX and POSIX-conforming systems, this file contains the userid, name, and password of each user.
Possible exit status values are:
Invalid user specified with the
Failure due to an invalid command line argument.
POSIX.2. x/OPEN Portability Guide 4.0. UNIX System V. Windows 7. Windows Server 2008 R2. Windows 8. Windows Server 2012. Windows 10. Windows Server 2016.
PTC MKS Toolkit for Power Users
PTC MKS Toolkit for System Administrators
PTC MKS Toolkit for Developers
PTC MKS Toolkit for Interoperability
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
PTC MKS Toolkit 10.1 patch 1 Documentation Build 2.