Id command
From RZWiki
A CLI command available on most Linux platforms; used to display user, group and process identities (UID, GID.)
Contents |
Usage Syntax
id [options]
Common options include;
- -Z - display only the security context of the current process - selinux enabled kernels only
- -g - display only the effective group ID (GID)
- -G - display all group IDs (GIDs)
- -u - display only the effective user ID (UID)
- -n - when used with one of: -u, -g or -G, display a name instead of a number
- -r - when used with one of: -u, -g or -G, display the real ID instead of the effective ID
Usage Examples
id - display effective user and group IDs and all group IDs, names and numbers
id -un - display only the effective user ID (UID) name
id -gr - display only the real group ID (GID)
Usage Notes
The root user always has a UID of 0.
Linux Usage Notes
With most Linux or Unix commands;
- Non root users may need to prefix commands with the sudo command, for example: sudo chmod 644 *
- Brief help can be displayed using the -h or --help parameter, for example: chmod --help
- A full command manual can be displayed using the man command followed by the command name, for example: man chmod
- Sometimes 'info' pages are used instead of or to provide more information than man pages; for example: info chmod
- Version information can normally be display using the -v, -V or --version parameter, for example: chmod --version. However, this paramater is also frequently used to display verbose output.
noinclude/noinclude
Typical Output
noinclude/noinclude
id;
uid=503(testuser) gid=501(bossteam) groups=501(bossteam)
Related Files
The id executable is normally found here: /usr/bin/id
Installation
This command is part of the GNU coreutils package, which can be installed or upgraded as follows, depending on your platform;
- Ubuntu: apt-get install coreutils
- Fedora Core: yum install coreutils
- FreeBSD: pkg_add -v -r coreutils
Related Articles
Information on other Linux commands
Information on F5 BigIP commands
Information on Cisco commands
Information on Vyatta commands
Information on Extreme commands
Information on Nortel commands
Information on Zebra commands
Information on Windows commands
Information on Secure Platform commands
Information on Blue Coat SGOS commands
Information on Nokia IPSO commands
(replacing the # with an @) |






