who(1) 맨 페이지 - 윈디하나의 솔라나라

개요

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

who(1)

who(1)                           User Commands                          who(1)

NAME
       who - who is on the system

SYNOPSIS
       /usr/bin/who [-a | --all] [-b | --boot] [-d | --dead]
                    [-H | --heading] [-l | --login] [--lookup] [-m]
                    [-p | --process] [-q | --count] [-r | --runlevel]
                    [-s | --short] [-t | --time]
                    [-T | -w | --mesg | --message | --writeable]
                    [-u | --users] [file]


       /usr/bin/who -q | --count [-n x] [file]


       /usr/bin/who am i


       /usr/bin/who am I


       /usr/xpg4/bin/who [-abdHlmpqrtTu] [file]


       /usr/xpg4/bin/who -q [-n x] [file]


       /usr/xpg4/bin/who -s [-bdHlmpqrtu] [file]


       /usr/xpg4/bin/who am i


       /usr/xpg4/bin/who am I

DESCRIPTION
       The  who  utility  can list the user's name, terminal line, login time,
       elapsed time since activity occurred on the line, and the process-ID of
       the command interpreter (shell) for each current UNIX system  user.  It
       examines  the /var/adm/utmpx file to obtain its information. If file is
       given, that file (which must be in utmpx(5) format) is  examined.  Usu‐
       ally,  file will be /var/adm/wtmpx, which contains a history of all the
       logins since the file was last created.


       The general format for output is:

         name [state] line time [idle] [pid] [comment] [exit] [(host)]



       where:

       name       User's login name


       state      Capability of writing to the terminal


       line       Name of the line found in /dev


       time       Time since user's login


       idle       Time elapsed since the user's last activity


       pid        User's process id


       comment    Comment line in inittab(5)


       exit       Exit status for dead processes


       host       Host from which login originated


OPTIONS
       The following options are supported in /usr/bin/who:

       -a, --all

           Processes /var/adm/utmpx or the named file with -b, -d, -l, -p, -r,
           -t, -T, and -u options turned on.


       -b, --boot

           Indicates the time and date of the last reboot.


       -d, --dead

           Displays all processes that have expired and not been respawned  by
           init.  The  exit  field appears for dead processes and contains the
           termination and exit values (as returned by wait(3C)), of the  dead
           process.  This  can  be  useful in determining why a process termi‐
           nated.


       -H, --heading

           Outputs column headings above the regular output.


       -l, --login

           Lists only those lines on which the system is waiting  for  someone
           to  login.  The name field is LOGIN in such cases. Other fields are
           the same as for user entries except that the state field  does  not
           exist.


       --lookup

           Performs  a  lookup  of the host in the configured name services to
           find the canonical (first defined) name of the host (see NOTES).


       -m

           Outputs only information about the current terminal.


       -n x

           Takes a numeric argument, x, which specifies the number of users to
           display per line. x must be at least 1. The -n option can  only  be
           used with -q.


       -p, --process

           Lists  any other process that is currently active and has been pre‐
           viously spawned by init. The name field is the name of the  program
           executed  by  init  as found in /usr/sbin/inittab. The state, line,
           and idle fields have no meaning. The comment  field  shows  the  id
           field of the line from /usr/sbin/inittab that spawned this process.
           See inittab(5).


       -q, --count

           (Quick  who)  Displays  only the names and the number of users cur‐
           rently logged on. When this option is used, all options other  than
           -n are ignored.


       -r, --runlevel

           Indicates the current run-level of the init process.


       -s, --short

           (Default)  Lists  only the name, line, time, and (if the host field
           is present in the utmpx entry) host fields.


       -T, --mesg, --message

           Same as the -s option, except that the state, idle, pid,  and  com‐
           ment fields are also written. state is one of the following charac‐
           ters:

           +       The terminal allows write access to other users.


           −       The terminal denies write access to other users.


           ?       The terminal write-access state cannot be determined.



       -t, --time

           Indicates the last change to the system clock (using the date util‐
           ity) by root. See su(8) and date(1).


       -u, --users

           Lists only those users who are currently logged in. The name is the
           user's login name. The line is the name of the line as found in the
           directory  /dev.  The time is the time that the user logged in. The
           idle column contains the number of hours and minutes since activity
           last occurred on that particular line. A dot (.) indicates that the
           terminal has seen activity in the last minute and is therefore cur‐
           rent. If more than twenty-four hours have elapsed or the  line  has
           not  been used since boot time, the entry is marked old. This field
           is useful when trying to determine whether a person is  working  at
           the terminal or not. The pid is the process-ID of the user's shell.
           The comment is the comment field associated with this line as found
           in /usr/sbin/inittab (see inittab(5)). This can contain information
           about  where  the  terminal is located, the telephone number of the
           dataset, type of terminal if hard-wired, and so forth.


       -w, --writeable

           Same as -T option


   /usr/xpg4/bin/who
       The following options are supported in /usr/xpg4/bin/who:

       -a    Processes /var/adm/utmpx or the named file with -b, -d,  -l,  -p,
             -r, -t, -T, and -u options turned on.


       -b    Indicates the time and date of the last reboot.


       -d    Displays  all  processes that have expired and not been respawned
             by init. The exit field appears for dead processes  and  contains
             the termination and exit values (as returned by wait(3C)), of the
             dead  process.  This  can  be useful in determining why a process
             terminated.


       -H    Outputs column headings above the regular output.


       -l    Lists only those lines on which the system is waiting for someone
             to login. The name field is LOGIN in such cases. Other fields are
             the same as for user entries except that the state field does not
             exist.


       -m    Outputs only information about the current terminal.


       -p    Lists any other process that is currently  active  and  has  been
             previously  spawned  by  init.  The name field is the name of the
             program executed by  init  as  found  in  /usr/sbin/inittab.  The
             state,  line,  and idle fields have no meaning. The comment field
             shows the id  field  of  the  line  from  /usr/sbin/inittab  that
             spawned this process. See inittab(5).


       -q    (Quick  who) Displays only the names and the number of users cur‐
             rently logged on. When this option is  used,  all  options  other
             than -n are ignored.


       -r    Indicates the current run-level of the init process.


       -s    (Default) Lists only the name, line, and time fields.


       -T    Same  as the -s option, except that the state field is also writ‐
             ten. state is one of the characters listed under the /usr/bin/who
             version of this option. If the -u option is  used  with  -T,  the
             idle time is added to the end of the previous format.


       -t    Indicates  the  last  change  to the system clock (using the date
             utility) by root. See su(8) and date(1).


       -u    Lists only those users who are currently logged in. The  name  is
             the  user's login name. The line is the name of the line as found
             in the directory /dev. The time is the time that the user  logged
             in.  The  idle  column  contains  the number of hours and minutes
             since activity last occurred on that particular line. A  dot  (.)
             indicates  that the terminal has seen activity in the last minute
             and is therefore current. If more  than  twenty-four  hours  have
             elapsed  or the line has not been used since boot time, the entry
             is marked old. This field is  useful  when  trying  to  determine
             whether  a  person  is working at the terminal or not. The pid is
             the process-ID of the user's shell. The comment  is  the  comment
             field  associated  with  this  line as found in /usr/sbin/inittab
             (see inittab(5)). This can contain information  about  where  the
             terminal is located, the telephone number of the dataset, type of
             terminal if hard-wired, and so forth.


OPERANDS
       The following operands are supported:

       am i    In  the  C locale, limits the output to describing the invoking
       am I    user, equivalent to the -m option. The am and i or  I  must  be
               separate arguments.



       file    Specifies  a path name of a file to substitute for the database
               of logged-on users that who uses by default.


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

EXIT STATUS
       The following exit values are returned:

       0     Successful completion.


       >0    An error occurred.


FILES
       /usr/sbin/inittab    Script for init


       /var/adm/utmpx       Current user and accounting information


       /var/adm/wtmpx       Historic user and accounting information


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

   /usr/bin/who
       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/who
       tab()  box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE TYPEAT‐
       TRIBUTE VALUE _ Availabilitysystem/xopen/xcu4  _  Interface  Stability‐
       Committed _ StandardSee standards(7).


SEE ALSO
       date(1),  login(1),  mesg(1),  wait(3C),  inittab(5), utmpx(5), attrib‐
       utes(7), environ(7), standards(7), init(8), su(8)

NOTES
       When the system is in the single-user state,  who  returns  no  output.
       Since  /var/adm/utmpx is updated at login time and there is no login in
       single-user state, who cannot report accurately on this state. The com‐
       mand, who am i, however, returns the correct information.


       The --lookup option is used to query the configured  name  services  to
       try  to  locate the so-called canonical name for the hostname specified
       in the utmpx entry. This will return the first  name  returned  by  the
       getaddrinfo(3C) function supplied with the AI_CANONNAME hint.


       The  host  field is set by the login software, and may include informa‐
       tion other than a network address or hostname, such as an X Window Sys‐
       tem DISPLAY id or a Solaris zone name.

HISTORY
       Support for the --all,  --boot,  --count,  --dead,  --heading,  --help,
       --login,  --lookup,  --mesg, --message, --process, --runlevel, --short,
       --time, --users, --writeable, and -w options was added to  /usr/bin/who
       in Solaris 11.4.0.


       Support  for  the  -m  option was added to both who commands in Solaris
       2.5.


       The /usr/xpg4/bin/who command was added in Solaris 2.5.


       Support for the -a, -b, -d, -H, -l, -n, -p, -q, -r, -s, -t, -T, and  -u
       options was added to /usr/bin/who in Solaris 2.0.


       The  who command, with support for the am i and file arguments has been
       present in all Sun and Oracle releases of Solaris.

Oracle Solaris 11.4               29 Nov 2022                           who(1)
맨 페이지 내용의 저작권은 맨 페이지 작성자에게 있습니다.
RSS ATOM XHTML 5 CSS3