id(8) 맨 페이지 - 윈디하나의 솔라나라

개요

섹션
맨 페이지 이름
검색(S)

id(8)

System Administration Commands                                           id(8)



NAME
       id - return user identity

SYNOPSIS
       /usr/bin/id [-p] [user]


       /usr/bin/id -a [-p] [user]


       /usr/bin/id -G [-n] [user]


       /usr/bin/id -g [-nr] [user]


       /usr/bin/id -u [-nr] [user]


       /usr/xpg4/bin/id [-p] [user]


       /usr/xpg4/bin/id -a [-p] [user]


       /usr/xpg4/bin/id -G [-n] [user]


       /usr/xpg4/bin/id -g [-nr] [user]


       /usr/xpg4/bin/id -u [-nr] [user]

DESCRIPTION
       If  no  user  operand  is  provided, the id utility writes the user and
       group IDs and the corresponding user and group names  of  the  invoking
       process to standard output. If the effective and real IDs do not match,
       both are written. If multiple groups are supported  by  the  underlying
       system,  /usr/xpg4/bin/id  also writes the supplementary group affilia‐
       tions of the invoking process.


       If a user operand is provided and the process has the appropriate priv‐
       ileges,  the  user  and  group IDs of the selected user are written. In
       this case, effective IDs are assumed to be identical to  real  IDs.  If
       the  selected  user has more than one allowable group membership listed
       in the group database, /usr/xpg4/bin/id writes them in the same  manner
       as the supplementary groups described in the preceding paragraph.

   Formats
       The  following  formats  are  used when the LC_MESSAGES locale category
       specifies the "C" locale. In other locales, the strings uid, gid, euid,
       egid,  and  groups may be replaced with more appropriate strings corre‐
       sponding to the locale.

         "uid=%u(%s) gid=%u(%s)\n" <real user ID>, <user-name>,
             <real group ID>, <group-name>



       If the effective and real user IDs do  not  match,  the  following  are
       inserted immediately before the \n character in the previous format:

         " euid=%u(%s)"



       with the following arguments added at the end of the argument list:

         <effective user ID>, <effective user-name>



       If  the  effective  and  real  group IDs do not match, the following is
       inserted directly before the \n character in  the  format  string  (and
       after  any  addition resulting from the effective and real user IDs not
       matching):

         " egid=%u(%s)"



       with the following arguments added at the end of the argument list:

         <effectivegroup-ID>, <effectivegroupname>



       If the process has supplementary group  affiliations  or  the  selected
       user  is  allowed  to  belong  to  multiple  groups, the first is added
       directly before the newline character in the format string:

         " groups=%u(%s)"



       with the following arguments added at the end of the argument list:

         <supplementary group ID>, <supplementary group name>



       and the necessary number of the following  added  after  that  for  any
       remaining supplementary group IDs:

         ",%u(%s)"



       and the necessary number of the following arguments added at the end of
       the argument list:

         <supplementary group ID>, <supplementary group name>



       If any of the user ID, group ID, effective user ID, effective group  ID
       or supplementary/multiple group IDs cannot be mapped by the system into
       printable user or group names, the corresponding (%s) and name argument
       is omitted from the corresponding format string.


       When  any  of  the  options  are  specified,  the  output  format is as
       described under OPTIONS.

OPTIONS
       The  following  options  are  supported   by   both   /usr/bin/id   and
       /usr/xpg4/bin/id.  The  -p and -a options are invalid if specified with
       any of the -G, -g, or -u options.

       -p    Reports additionally the current project membership of the invok‐
             ing process. The project is reported using the format:


               "projid=%u(%s)"

             which is inserted prior to the \n character of the default format
             described in the Formats section. The arguments


               <project ID>,<project name>

             are appended to the end of the argument list. If the  project  ID
             cannot be mapped by the system into a printable project name, the
             corresponding (%s) and name argument is omitted from  the  corre‐
             sponding format string.


       -a    Reports  user  name, user ID and all the groups to which the user
             belongs.


       -G    Outputs all different group IDs (effective, real  and  supplemen‐
             tary)  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 newline character is output.


       -g    Outputs only the effective group ID, using the format "%u\n".


       -n    Outputs  the  name  in  the format "%s" instead of the numeric ID
             using the format "%u".


       -r    Outputs the real ID instead of the effective ID.


       -u    Outputs only the effective user ID, using the format "%u\n".


OPERANDS
       The following operand is supported:

       user    The user (login) name for which information is to be written.


ENVIRONMENT VARIABLES
       See environ(7) for descriptions of the following environment  variables
       that  affect  the execution of id: LANG, LC_ALL, LC_CTYPE, LC_MESSAGES,
       and NLSPATH.

EXIT STATUS
       The following exit values are returned:

       0     Successful completion.


       >0    An error occurred.


ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:

   /usr/bin/id
       tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE  TYPEAT‐
       TRIBUTE VALUE _ Availabilitysystem/core-os _ Interface StabilityCommit‐
       ted


   /usr/xpg4/bin/id
       tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE  TYPEAT‐
       TRIBUTE  VALUE  _ Availabilitysystem/xopen/xcu4 _ Interface StabilityS‐
       tandard


SEE ALSO
       fold(1), logname(1),  who(1),  getgid(2),  getgroups(2),  getprojid(2),
       getuid(2), attributes(7), environ(7), standards(7)

NOTES
       Output  produced  by the -G option and by the default case could poten‐
       tially produce very long lines on systems that support large numbers of
       supplementary groups.

HISTORY
       The  -a  flag was added to /usr/xpg4/bin/id and the -G, -g, -n, -r, and
       -u options were added to /usr/bin/id in Oracle  Solaris  11.0.0,  using
       work contributed to OpenSolaris.


       The -p flag was added to /usr/bin/id and /usr/xpg4/bin/id in Solaris 9.


       The  /usr/xpg4/bin/id command, with the -G, -g, -n, -r, and -u options,
       was added in Solaris 2.5.


       The -a flag was added to /usr/bin/id in Solaris 2.0.


       The /usr/bin/id command  has  been  included  in  all  Sun  and  Oracle
       releases of Solaris.



Oracle Solaris 11.4               21 Jun 2021                            id(8)
맨 페이지 내용의 저작권은 맨 페이지 작성자에게 있습니다.
RSS ATOM XHTML 5 CSS3