ID(1) General Commands Manual ID(1)

idreturn user identity

id [-Ggu] [-nr] [user]

By default id prints the current ‘uid’, ‘gid’ and ‘groups’ of the current session. If user is specifies then it reads from the passwd(5) and group(5) entries.

Output only groups (effective, real, and supplementary) separated by spaces.
Output only the effective group ID.
Output only the effective user ID.
Output names instead of IDs.
Output the real IDs instead of effective IDs.

The id utility exits 0 on success, and >0 if an error occurs.

group(5), passwd(5)

id should be compliant with the IEEE Std 1003.1-2024 (“POSIX.1”) specification.

Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>

2023-10-02 Linux 6.6.67-gentoo-x86_64