Category
Linux Command
Usage
id [OPTION]... [USERNAME]
Manual
Required arguments
- username: The username for which you want to retrieve user and group information when specified; otherwise for the current user. username is a string.
Options
- -g, --group: Display only the group ID of the specified user. Example:
id -g username
- -u, --user: Display only the user ID of the specified user. Example:
id -u username
- -G, --groups: Display a list of supplementary groups to which the specified user belongs. Example:
id -G username
- -n, --name: Display the name instead of the ID. Example:
id -n username
- -r, --real: Display the real user or group ID. Example:
id -r username
- -Z, --context: print only the security context of the current user. This works only on an SELinux-enabled kernel.
Share your experience or ask a question