1WHO(1P)                    POSIX Programmer's Manual                   WHO(1P)
2
3
4

PROLOG

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

NAME

12       who - display who is on the system
13

SYNOPSIS

15       who [-mTu]
16
17
18
19       who [-mu]-s[-bHlprt][file]
20
21       who [-mTu][-abdHlprt][file]
22
23       who -q [file]
24
25       who am i
26
27       who am I
28
29

DESCRIPTION

31       The who utility shall list various pieces of information about accessi‐
32       ble users. The domain of accessibility is implementation-defined.
33
34       Based on the options given, who can also list the user's name, terminal
35       line, login time, elapsed time since activity occurred on the line, and
36       the process ID of the command interpreter for each current system user.
37

OPTIONS

39       The  who  utility  shall  conform  to  the  Base  Definitions volume of
40       IEEE Std 1003.1-2001, Section 12.2, Utility Syntax Guidelines.
41
42       The following options shall be supported. The  metavariables,  such  as
43       <line>, refer to fields described in the STDOUT section.
44
45       -a     Process  the  implementation-defined database or named file with
46              the -b, -d, -l, -p, -r, -t, -T and -u options turned on.
47
48       -b     Write the time and date of the last reboot.
49
50       -d     Write a list of all processes that have  expired  and  not  been
51              respawned  by  the  init  system process. The <exit> field shall
52              appear for dead processes and contain the termination  and  exit
53              values  of  the  dead process. This can be useful in determining
54              why a process terminated.
55
56       -H     Write column headings above the regular output.
57
58       -l     (The letter ell.) List only those lines on which the  system  is
59              waiting for someone to login. The <name> field shall be LOGIN in
60              such cases. Other fields shall be the same as for  user  entries
61              except that the <state> field does not exist.
62
63       -m     Output only information about the current terminal.
64
65       -p     List  any  other  process  that is currently active and has been
66              previously spawned by init.
67
68       -q     (Quick.) List only the names and the number of  users  currently
69              logged  on. When this option is used, all other options shall be
70              ignored.
71
72       -r     Write the current run-level of the init process.
73
74       -s     List only the <name>, <line>, and <time> fields.   This  is  the
75              default case.
76
77       -t     Indicate the last change to the system clock.
78
79       -T     Show the state of each terminal, as described in the STDOUT sec‐
80              tion.
81
82       -u     Write "idle time" for each displayed user  in  addition  to  any
83              other  information. The idle time is the time since any activity
84              occurred on the user's terminal. The method of determining  this
85              is unspecified.  This option shall list only those users who are
86              currently logged in. The <name> is the user's  login  name.  The
87              <line>  is  the name of the line as found in the directory /dev.
88              The <time> is the time that the user logged in.  The  <activity>
89              is  the number of hours and minutes since activity last occurred
90              on that particular line. A dot indicates that the  terminal  has
91              seen  activity in the last minute and is therefore "current". If
92              more than twenty-four hours have elapsed or  the  line  has  not
93              been used since boot time, the entry shall be marked <old>. This
94              field is useful when trying to determine  whether  a  person  is
95              working  at  the terminal or not. The <pid> is the process ID of
96              the user's login process.
97
98

OPERANDS

100       The following operands shall be supported:
101
102       am i, am I
103              In the POSIX locale, limit the output to describing the invoking
104              user,  equivalent  to  the  -m option. The am and i or I must be
105              separate arguments.
106
107       file   Specify a pathname of a file to substitute for  the  implementa‐
108              tion-defined  database  of  logged-on  users  that  who  uses by
109              default.
110
111

STDIN

113       Not used.
114

INPUT FILES

116       None.
117

ENVIRONMENT VARIABLES

119       The following environment variables shall affect the execution of who:
120
121       LANG   Provide a default value for the  internationalization  variables
122              that  are  unset  or  null.  (See the Base Definitions volume of
123              IEEE Std 1003.1-2001, Section  8.2,  Internationalization  Vari‐
124              ables  for the precedence of internationalization variables used
125              to determine the values of locale categories.)
126
127       LC_ALL If set to a non-empty string value, override the values  of  all
128              the other internationalization variables.
129
130       LC_CTYPE
131              Determine  the  locale  for  the  interpretation of sequences of
132              bytes of text data as characters (for  example,  single-byte  as
133              opposed to multi-byte characters in arguments).
134
135       LC_MESSAGES
136              Determine  the  locale  that should be used to affect the format
137              and contents of diagnostic messages written to standard error.
138
139       LC_TIME
140              Determine the locale used for the format  and  contents  of  the
141              date and time strings.
142
143       NLSPATH
144              Determine the location of message catalogs for the processing of
145              LC_MESSAGES .
146
147       TZ     Determine the timezone used when writing date and time  informa‐
148              tion.   If  TZ is unset or null, an unspecified default timezone
149              shall be used.
150
151

ASYNCHRONOUS EVENTS

153       Default.
154

STDOUT

156       The who utility shall write its default format to the  standard  output
157       in an implementation-defined format, subject only to the requirement of
158       containing the information described above.
159
160       XSI-conformant systems shall write the default information to the stan‐
161       dard output in the following general format:
162
163
164              <name>[<state>]<line><time>[<activity>][<pid>][<comment>][<exit>]
165
166       The following format shall be used for the -T option:
167
168
169              "%s %c %s %s\n" <name>, <terminal state>, <terminal name>,
170                  <time of login>
171
172       where <terminal state> is one of the following characters:
173
174       +      The terminal allows write access to other users.
175
176       -      The terminal denies write access to other users.
177
178       ?      The terminal write-access state cannot be determined.
179
180
181       In  the POSIX locale, the <time of login> shall be equivalent in format
182       to the output of:
183
184
185              date +"%b %e %H:%M"
186
187       If the -u option is used with -T, the idle time shall be added  to  the
188       end of the previous format in an unspecified format.
189

STDERR

191       The standard error shall be used only for diagnostic messages.
192

OUTPUT FILES

194       None.
195

EXTENDED DESCRIPTION

197       None.
198

EXIT STATUS

200       The following exit values shall be returned:
201
202        0     Successful completion.
203
204       >0     An error occurred.
205
206

CONSEQUENCES OF ERRORS

208       Default.
209
210       The following sections are informative.
211

APPLICATION USAGE

213       The  name init used for the system process is the most commonly used on
214       historical systems, but it may vary.
215
216       The "domain of accessibility" referred to is a broad concept that  per‐
217       mits  interpretation  either  on a very secure basis or even to allow a
218       network-wide implementation like the historical rwho.
219

EXAMPLES

221       None.
222

RATIONALE

224       Due to differences between historical implementations, the base options
225       provided were a compromise to allow users to work with those functions.
226       The standard developers also considered removing all the  options,  but
227       felt  that  these  options  offered users valuable functionality. Addi‐
228       tional options to match historical systems are available on XSI-confor‐
229       mant systems.
230
231       It  is  recognized  that  the who command may be of limited usefulness,
232       especially in a multi-level secure environment. The standard developers
233       considered,  however,  that  having some standard method of determining
234       the "accessibility" of other users would aid user portability.
235
236       No format was specified for the default who output for systems not sup‐
237       porting  the  XSI  Extension. In such a user-oriented command, designed
238       only for human use, this was not considered to be a deficiency.
239
240       The format of the terminal name is unspecified, but the descriptions of
241       ps, talk, and write require that they use the same format.
242
243       It  is  acceptable  for  an  implementation to produce no output for an
244       invocation of who mil.
245

FUTURE DIRECTIONS

247       None.
248

SEE ALSO

250       mesg
251
253       Portions of this text are reprinted and reproduced in  electronic  form
254       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
255       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
256       Specifications  Issue  6,  Copyright  (C) 2001-2003 by the Institute of
257       Electrical and Electronics Engineers, Inc and The Open  Group.  In  the
258       event of any discrepancy between this version and the original IEEE and
259       The Open Group Standard, the original IEEE and The Open Group  Standard
260       is  the  referee document. The original Standard can be obtained online
261       at http://www.opengroup.org/unix/online.html .
262
263
264
265IEEE/The Open Group                  2003                              WHO(1P)
Impressum