Log in Go to the main page Page Discussion History Go to the file list Go to the site toolbox Bookmark and Share

Id command

From RZWiki


Image:linux-logo-large.png

A CLI command available on most Linux platforms; used to display user, group and process identities (UID, GID.)

Contents

Image:Vm-power-on-medium.png 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

Image:Vm-power-on-medium.png 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)

Image:accessories-text-editor-v2-medium.png Usage Notes

The root user always has a UID of 0.

Image:accessories-text-editor-v2-medium.png 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

Image:utilities-terminal-medium-v2.png Typical Output

noinclude/noinclude

id;

uid=503(testuser) gid=501(bossteam) groups=501(bossteam)

Image:Folder-medium.png Related Files

The id executable is normally found here: /usr/bin/id

Image:emblem-package-medium.png 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

Image:icemon-medium.png Related Articles

Information on other Linux commands Image:linux-logo-small.png

Information on F5 BigIP commands Image:F5-logo-small.png

Information on Cisco commands Image:Cisco-logo-small.png

Information on Vyatta commands Image:Vyatta-logo-small.png

Information on Extreme commands Image:Extreme-logo-small.png

Information on Nortel commands Image:Nortel-logo-small.png

Information on Zebra commands

Information on Windows commands Image:Preferences-system-windows-small.png

Information on Secure Platform commands

Information on Blue Coat SGOS commands

Information on Nokia IPSO commands


Image:internet-group-chat-small.png We really do appreciate all feedback so please do send your comments, suggestions or corrections to sjiveson#routerzone.eu
(replacing the # with an @)


Site Toolbox:

Personal tools
This page was last modified on 11 December 2009, at 15:51. - Disclaimers - About RZWiki
Powered by MediaWiki