WHO(1)                     POSIX Programmer's Manual                    WHO(1)



PPRROOLLOOGG
       This manual page is part of the POSIX Programmer's Manual.  The OS
       implementation of this interface may differ (consult the corresponding
       OS manual page for details of OS behavior), or the interface may not be
       implemented on OS.

NNAAMMEE
       who -- display who is on the system

SSYYNNOOPPSSIISS
       who [[-mTu]] [[-abdHlprt]] [[_f_i_l_e]]

       who [[-mu]] -s [[-bHlprt]] [[_f_i_l_e]]

       who -q [[_f_i_l_e]]

       who am i

       who am I

DDEESSCCRRIIPPTTIIOONN
       The _w_h_o utility shall list various pieces of information about
       accessible users. The domain of accessibility is implementation-
       defined.

       Based on the options given, _w_h_o can also 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 for each current system user.

OOPPTTIIOONNSS
       The _w_h_o utility shall conform to the Base Definitions volume of
       POSIX.1-2017, _S_e_c_t_i_o_n _1_2_._2, _U_t_i_l_i_t_y _S_y_n_t_a_x _G_u_i_d_e_l_i_n_e_s.

       The following options shall be supported. The metavariables, such as
       <_l_i_n_e>, refer to fields described in the STDOUT section.

       --aa        Process the implementation-defined database or named file
                 with the --bb, --dd, --ll, --pp, --rr, --tt, --TT and --uu options turned on.

       --bb        Write the time and date of the last system reboot. The system
                 reboot time is the time at which the implementation is able
                 to commence running processes.

       --dd        Write a list of all processes that have expired and not been
                 respawned by the _i_n_i_t system process. The <_e_x_i_t> field shall
                 appear for dead processes and contain the termination and
                 exit values of the dead process. This can be useful in
                 determining why a process terminated.

       --HH        Write column headings above the regular output.

       --ll        (The letter ell.) List only those lines on which the system
                 is waiting for someone to login. The <_n_a_m_e> field shall be
                 LLOOGGIINN in such cases. Other fields shall be the same as for
                 user entries except that the <_s_t_a_t_e> field does not exist.

       --mm        Output only information about the current terminal.

       --pp        List any other process that is currently active and has been
                 previously spawned by _i_n_i_t.

       --qq        (Quick.) List only the names and the number of users
                 currently logged on. When this option is used, all other
                 options shall be ignored.

       --rr        Write the current _r_u_n_-_l_e_v_e_l of the _i_n_i_t process.

       --ss        List only the <_n_a_m_e>, <_l_i_n_e>, and <_t_i_m_e> fields.  This is the
                 default case.

       --tt        Indicate the last change to the system clock.

       --TT        Show the state of each terminal, as described in the STDOUT
                 section.

       --uu        Write ``idle time'' for each displayed user in addition to
                 any other information. The idle time is the time since any
                 activity occurred on the user's terminal. The method of
                 determining this is unspecified.  This option shall list only
                 those users who are currently logged in.  The <_n_a_m_e> is the
                 user's login name. The <_l_i_n_e> is the name of the line as
                 found in the directory //ddeevv.  The <_t_i_m_e> is the time that the
                 user logged in. The <_a_c_t_i_v_i_t_y> is 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 shall be marked <_o_l_d>. This field
                 is useful when trying to determine whether a person is
                 working at the terminal or not. The <_p_i_d> is the process ID
                 of the user's login process.

OOPPEERRAANNDDSS
       The following operands shall be supported:

       aamm ii, aamm II
                 In the POSIX locale, limit the output to describing the
                 invoking user, equivalent to the --mm option. The aamm and ii or II
                 must be separate arguments.

       _f_i_l_e      Specify a pathname of a file to substitute for the
                 implementation-defined database of logged-on users that _w_h_o
                 uses by default.

SSTTDDIINN
       Not used.

IINNPPUUTT FFIILLEESS
       None.

EENNVVIIRROONNMMEENNTT VVAARRIIAABBLLEESS
       The following environment variables shall affect the execution of _w_h_o:

       _L_A_N_G      Provide a default value for the internationalization
                 variables that are unset or null. (See the Base Definitions
                 volume of POSIX.1-2017, _S_e_c_t_i_o_n _8_._2, _I_n_t_e_r_n_a_t_i_o_n_a_l_i_z_a_t_i_o_n
                 _V_a_r_i_a_b_l_e_s for the precedence of internationalization
                 variables used to determine the values of locale categories.)

       _L_C___A_L_L    If set to a non-empty string value, override the values of
                 all the other internationalization variables.

       _L_C___C_T_Y_P_E  Determine the locale for the interpretation of sequences of
                 bytes of text data as characters (for example, single-byte as
                 opposed to multi-byte characters in arguments).

       _L_C___M_E_S_S_A_G_E_S
                 Determine the locale that should be used to affect the format
                 and contents of diagnostic messages written to standard
                 error.

       _L_C___T_I_M_E   Determine the locale used for the format and contents of the
                 date and time strings.

       _N_L_S_P_A_T_H   Determine the location of message catalogs for the processing
                 of _L_C___M_E_S_S_A_G_E_S.

       _T_Z        Determine the timezone used when writing date and time
                 information. If _T_Z is unset or null, an unspecified default
                 timezone shall be used.

AASSYYNNCCHHRROONNOOUUSS EEVVEENNTTSS
       Default.

SSTTDDOOUUTT
       The _w_h_o utility shall write its default format to the standard output
       in an implementation-defined format, subject only to the requirement of
       containing the information described above.

       XSI-conformant systems shall write the default information to the
       standard output in the following general format:


           <_n_a_m_e>[[<_s_t_a_t_e>]]<_l_i_n_e><_t_i_m_e>[[<_a_c_t_i_v_i_t_y>]][[<_p_i_d>]][[<_c_o_m_m_e_n_t>]][[<_e_x_i_t>]]

       For the --bb option, <_l_i_n_e> shall be ""ssyysstteemmboot"..  The <_n_a_m_e> is
       unspecified.

       The following format shall be used for the --TT option:


           "%s %c %s %s\n" <_n_a_m_e>, <_t_e_r_m_i_n_a_l _s_t_a_t_e>, <_t_e_r_m_i_n_a_l _n_a_m_e>,
               <_t_i_m_e _o_f _l_o_g_i_n>

       where <_t_e_r_m_i_n_a_l _s_t_a_t_e> is one of the following characters:

       +       The terminal allows write access to other users.

       -       The terminal denies write access to other users.

       ?       The terminal write-access state cannot be determined.

       <space> This entry is not associated with a terminal.

       In the POSIX locale, the <_t_i_m_e _o_f _l_o_g_i_n> shall be equivalent in format
       to the output of:


           date +"%b %e %H:%M"

       If the --uu option is used with --TT, the idle time shall be added to the
       end of the previous format in an unspecified format.

SSTTDDEERRRR
       The standard error shall be used only for diagnostic messages.

OOUUTTPPUUTT FFIILLEESS
       None.

EEXXTTEENNDDEEDD DDEESSCCRRIIPPTTIIOONN
       None.

EEXXIITT SSTTAATTUUSS
       The following exit values shall be returned:

        0    Successful completion.

       >0    An error occurred.

CCOONNSSEEQQUUEENNCCEESS OOFF EERRRROORRSS
       Default.

       _T_h_e _f_o_l_l_o_w_i_n_g _s_e_c_t_i_o_n_s _a_r_e _i_n_f_o_r_m_a_t_i_v_e_.

AAPPPPLLIICCAATTIIOONN UUSSAAGGEE
       The name _i_n_i_t used for the system process is the most commonly used on
       historical systems, but it may vary.

       The ``domain of accessibility'' referred to is a broad concept that
       permits interpretation either on a very secure basis or even to allow a
       network-wide implementation like the historical _r_w_h_o.

EEXXAAMMPPLLEESS
       None.

RRAATTIIOONNAALLEE
       Due to differences between historical implementations, the base options
       provided were a compromise to allow users to work with those functions.
       The standard developers also considered removing all the options, but
       felt that these options offered users valuable functionality.
       Additional options to match historical systems are available on XSI-
       conformant systems.

       It is recognized that the _w_h_o command may be of limited usefulness,
       especially in a multi-level secure environment. The standard developers
       considered, however, that having some standard method of determining
       the ``accessibility'' of other users would aid user portability.

       No format was specified for the default _w_h_o output for systems not
       supporting the XSI option. In such a user-oriented command, designed
       only for human use, this was not considered to be a deficiency.

       The format of the terminal name is unspecified, but the descriptions of
       _p_s, _t_a_l_k, and _w_r_i_t_e require that they use the same format.

       It is acceptable for an implementation to produce no output for an
       invocation of _w_h_o mmiill.

FFUUTTUURREE DDIIRREECCTTIIOONNSS
       None.

SSEEEE AALLSSOO
       _m_e_s_g

       The Base Definitions volume of POSIX.1-2017, _C_h_a_p_t_e_r _8, _E_n_v_i_r_o_n_m_e_n_t
       _V_a_r_i_a_b_l_e_s, _S_e_c_t_i_o_n _1_2_._2, _U_t_i_l_i_t_y _S_y_n_t_a_x _G_u_i_d_e_l_i_n_e_s

CCOOPPYYRRIIGGHHTT
       Portions of this text are reprinted and reproduced in electronic form
       from IEEE Std 1003.1-2017, Standard for Information Technology --
       Portable Operating System Interface (POSIX), The Open Group Base
       Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the
       Institute of Electrical and Electronics Engineers, Inc and The Open
       Group.  In the event of any discrepancy between this version and the
       original IEEE and The Open Group Standard, the original IEEE and The
       Open Group Standard is the referee document. The original Standard can
       be obtained online at http://www.opengroup.org/unix/online.html .

       Any typographical or formatting errors that appear in this page are
       most likely to have been introduced during the conversion of the source
       files to man page format. To report such errors, see
       https://www.kernel.org/doc/man-pages/reporting_bugs.html .



IEEE/The Open Group                  2017                               WHO(1)
