Linux and Unix id command
Quick links
About id
Syntax
Examples
Related commands
Linux and Unix main page
Shows you the numeric user and group ID on BSD.
id [-a] [-G] [-g] [-u] [user]
| -a | Reports user name, use ID and all the groups to which the user belongs. |
| -G | Output all different group IDs (effective, real and supplementary) only, using the format "%u\n". If there is more than one distinct group affiliation, output each such affiliation, using the format " %u", before the new line character is output. |
| -g | Output only the effective group ID, using the format "%u\n". |
| -n | Output the name in the format "%s" instead of the numeric ID using the format "%u". |
| -r | Output the real ID instead of the effective ID. |
| -u | Output only the effective user ID, using the format "%u\n". |
| user | The user (login) name for which information is to be written. |
id
Typing id alone will report the user id and group similar to the below example.
uid=12345(comphope) gid=12(users)
