Display user identity
id -F|-P|-p [user]
id -G [-n] [user]
id -g|-u [-nr] [user]
Outputs 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 ooutput, otherwise only the real ID is output.
user (login name or user ID) is specified, the user and group IDs of that user are output ( the
real and effective IDs are assumed to be the same).
| full name of the user.
| effective user ID
| effective group ID
| with |
-g and -u real ID
| group IDs (effective, real and supplementary) as white-space separated numbers.|
20 12 61 79 80 81 98 703 702 701 33 100 204 250 395 398 101 400
| name of the IDs for |
-G, -g and -u
IDs that cannot be mapped into names are displayed as numbers.
id -G -n
staff everyone localaccounts _appserverusr admin _appserveradm _lpadmin …
/etc/password file entry.
| On seperate lines:|
If the user name returned by
getlogin is different from the login name referenced by the user ID,
login and the user name returned by
getlogin is output.
If the effective user ID is different from the real user ID,
euid and the real user ID is output as a name.
If the effective group ID is different from the real group ID,
rgid and the real group ID is output as a name.
groups and the list of groups to which the user belongs is output as names.
> id -p
groups staff everyone localaccounts _appserverusr admin _appserveradm _lpadmin …
| process audit user ID and other process audit properties, which requires privilege.|
Example:output is one string. Edited here for your viewing pleasure.
The historic groups(1) command is equivalent to
id -Gn [user].
Linux version does not provide
-A, -F, -P, -p, it does include:
| with SELinux output the security context of the current user
| output all group IDs
| delimit entries with NUL characters