id prints information about the given user, or the process running it if no user is specified. Synopsis:
id [option]... [user]
user can be either a user ID or a name, with name look-up taking precedence unless the ID is specified with a leading ‘+’. See Disambiguating names and IDs.
By default, it prints the real user ID, real group ID, effective user ID if different from the real user ID, effective group ID if different from the real group ID, and supplemental group IDs. In addition, if SELinux is enabled and the POSIXLY_CORRECT environment variable is not set, then print ‘context=c’, where c is the security context.
Each of these numeric values is preceded by an identifying string and followed by the corresponding user or group name in parentheses.
The options cause id to print only part of the above information. Also see Common options.
$ id -Gn --zero users <NUL> devs <NUL>
Primary and supplementary groups for a process are normally inherited from its parent and are usually unchanged since login. This means that if you change the group database after logging in, id will not reflect your changes within your existing login session. Running id with a user argument causes the user and group database to be consulted afresh, and so will give a different result.
An exit status of zero indicates success, and a nonzero value indicates failure.