id Command

Displaying user and group Information

The id command is used to display user and group information for the specified USER, or (when USER omitted) for the current user.

id command options

Below are a list of the available options that can be used with the "id" command.


SYNOPSIS
       id [OPTION]... [USER]

DESCRIPTION
       Print  user and group information for the specified USER, or (when USER
       omitted) for the current user.

       -a     ignore, for compatibility with other versions

       -Z, --context
              print only the security context of the process

       -g, --group
              print only the effective group ID

       -G, --groups
              print all group IDs

       -n, --name
              print a name instead of a number, for -ugG

       -r, --real
              print the real ID instead of the effective ID, with -ugG

       -u, --user
              print only the effective user ID

       -z, --zero
              delimit entries with NUL characters, not whitespace;

              not permitted in default format

       --help display this help and exit

       --version
              output version information and exit

Display user and group membership information

Basic syntax: id user


john@mint01a:~$ id john
uid=1000(john) gid=1000(john) groups=1000(john),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),114(lpadmin),134(sambashare),138(libvirt)