id
id [OPTION]... [UTILISATEUR]...
Affiche les informations d’utilisateur et de groupe pour chaque UTILISATEUR spécifié, ou (si UTILISATEUR est omis) pour l’utilisateur actuel.
Options
--ignore,-a-
ignore, for compatibility with other versions
-A-
Display the process audit user ID and other process audit properties,
which requires privilege (not available on Linux). --user,-u-
Display only the effective user ID as a number.
--group,-g-
Display only the effective group ID as a number
--groups,-G-
Display only the different group IDs as white-space separated numbers,
in no particular order. -p-
Make the output human-readable. Each display is on a separate line.
--name,-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-
Display the id as a password file entry.
--real,-r-
Display the real ID for the -G, -g and -u options instead of
the effective ID. --zero,-z-
delimit entries with NUL characters, not whitespace;
not permitted in default format --context,-Z-
print only the security context of the process
L’utilitaire id affiche les noms d’utilisateur et de groupe ainsi que leurs ID numériques du processus appelant, vers la sortie standard. Si les ID réels et effectifs sont différents, les deux sont affichés, sinon seul l’ID réel est affiché.
Si un utilisateur (nom de connexion ou ID utilisateur) est spécifié, les ID utilisateur et groupe de cet utilisateur sont affichés. Dans ce cas, les ID réels et effectifs sont supposés être identiques.
Examples
Display current user’s ID (UID), group ID (GID), and groups to which they belong:
id
Display the current user identity:
id {{[-un|--user --name]}}
Display the current user identity as a number:
id {{[-u|--user]}}
Display the current primary group identity:
id {{[-gn|--group --name]}}
Display the current primary group identity as a number:
id {{[-g|--group]}}
Display all groups the current user belongs to:
id {{[-Gn|--groups --name]}}
Display an arbitrary user’s ID (UID), group ID (GID), and groups to which they belong:
id {{username}}
Skip name lookup and specify the UID number explicitly:
id +{{uid_number}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.