1WHO(1P) POSIX Programmer's Manual WHO(1P)
2
3
4
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
12 who — display who is on the system
13
15 who [-mTu] [-abdHlprt] [file]
16
17 who [-mu] -s [-bHlprt] [file]
18
19 who -q [file]
20
21 who am i
22
23 who am I
24
26 The who utility shall list various pieces of information about accessi‐
27 ble users. The domain of accessibility is implementation-defined.
28
29 Based on the options given, who can also list the user's name, terminal
30 line, login time, elapsed time since activity occurred on the line, and
31 the process ID of the command interpreter for each current system user.
32
34 The who utility shall conform to the Base Definitions volume of
35 POSIX.1‐2017, Section 12.2, Utility Syntax Guidelines.
36
37 The following options shall be supported. The metavariables, such as
38 <line>, refer to fields described in the STDOUT section.
39
40 -a Process the implementation-defined database or named file
41 with the -b, -d, -l, -p, -r, -t, -T and -u options turned on.
42
43 -b Write the time and date of the last system reboot. The system
44 reboot time is the time at which the implementation is able
45 to commence running processes.
46
47 -d Write a list of all processes that have expired and not been
48 respawned by the init system process. The <exit> field shall
49 appear for dead processes and contain the termination and
50 exit values of the dead process. This can be useful in deter‐
51 mining why a process terminated.
52
53 -H Write column headings above the regular output.
54
55 -l (The letter ell.) List only those lines on which the system
56 is waiting for someone to login. The <name> field shall be
57 LOGIN in such cases. Other fields shall be the same as for
58 user entries except that the <state> field does not exist.
59
60 -m Output only information about the current terminal.
61
62 -p List any other process that is currently active and has been
63 previously spawned by init.
64
65 -q (Quick.) List only the names and the number of users cur‐
66 rently logged on. When this option is used, all other options
67 shall be ignored.
68
69 -r Write the current run-level of the init process.
70
71 -s List only the <name>, <line>, and <time> fields. This is the
72 default case.
73
74 -t Indicate the last change to the system clock.
75
76 -T Show the state of each terminal, as described in the STDOUT
77 section.
78
79 -u Write ``idle time'' for each displayed user in addition to
80 any other information. The idle time is the time since any
81 activity occurred on the user's terminal. The method of
82 determining this is unspecified. This option shall list only
83 those users who are currently logged in. The <name> is the
84 user's login name. The <line> is the name of the line as
85 found in the directory /dev. The <time> is the time that the
86 user logged in. The <activity> is the number of hours and
87 minutes since activity last occurred on that particular line.
88 A dot indicates that the terminal has seen activity in the
89 last minute and is therefore ``current''. If more than
90 twenty-four hours have elapsed or the line has not been used
91 since boot time, the entry shall be marked <old>. This field
92 is useful when trying to determine whether a person is work‐
93 ing at the terminal or not. The <pid> is the process ID of
94 the user's login process.
95
97 The following operands shall be supported:
98
99 am i, am I
100 In the POSIX locale, limit the output to describing the
101 invoking user, equivalent to the -m option. The am and i or I
102 must be separate arguments.
103
104 file Specify a pathname of a file to substitute for the implemen‐
105 tation-defined database of logged-on users that who uses by
106 default.
107
109 Not used.
110
112 None.
113
115 The following environment variables shall affect the execution of who:
116
117 LANG Provide a default value for the internationalization vari‐
118 ables that are unset or null. (See the Base Definitions vol‐
119 ume of POSIX.1‐2017, Section 8.2, Internationalization Vari‐
120 ables for the precedence of internationalization variables
121 used to determine the values of locale categories.)
122
123 LC_ALL If set to a non-empty string value, override the values of
124 all the other internationalization variables.
125
126 LC_CTYPE Determine the locale for the interpretation of sequences of
127 bytes of text data as characters (for example, single-byte as
128 opposed to multi-byte characters in arguments).
129
130 LC_MESSAGES
131 Determine the locale that should be used to affect the format
132 and contents of diagnostic messages written to standard
133 error.
134
135 LC_TIME Determine the locale used for the format and contents of the
136 date and time strings.
137
138 NLSPATH Determine the location of message catalogs for the processing
139 of LC_MESSAGES.
140
141 TZ Determine the timezone used when writing date and time infor‐
142 mation. If TZ is unset or null, an unspecified default time‐
143 zone shall be used.
144
146 Default.
147
149 The who utility shall write its default format to the standard output
150 in an implementation-defined format, subject only to the requirement of
151 containing the information described above.
152
153 XSI-conformant systems shall write the default information to the stan‐
154 dard output in the following general format:
155
156
157 <name>[<state>]<line><time>[<activity>][<pid>][<comment>][<exit>]
158
159 For the -b option, <line> shall be "systemboot". The <name> is unspec‐
160 ified.
161
162 The following format shall be used for the -T option:
163
164
165 "%s %c %s %s\n" <name>, <terminal state>, <terminal name>,
166 <time of login>
167
168 where <terminal state> is one of the following characters:
169
170 + The terminal allows write access to other users.
171
172 - The terminal denies write access to other users.
173
174 ? The terminal write-access state cannot be determined.
175
176 <space> This entry is not associated with a terminal.
177
178 In the POSIX locale, the <time of login> shall be equivalent in format
179 to the output of:
180
181
182 date +"%b %e %H:%M"
183
184 If the -u option is used with -T, the idle time shall be added to the
185 end of the previous format in an unspecified format.
186
188 The standard error shall be used only for diagnostic messages.
189
191 None.
192
194 None.
195
197 The following exit values shall be returned:
198
199 0 Successful completion.
200
201 >0 An error occurred.
202
204 Default.
205
206 The following sections are informative.
207
209 The name init used for the system process is the most commonly used on
210 historical systems, but it may vary.
211
212 The ``domain of accessibility'' referred to is a broad concept that
213 permits interpretation either on a very secure basis or even to allow a
214 network-wide implementation like the historical rwho.
215
217 None.
218
220 Due to differences between historical implementations, the base options
221 provided were a compromise to allow users to work with those functions.
222 The standard developers also considered removing all the options, but
223 felt that these options offered users valuable functionality. Addi‐
224 tional options to match historical systems are available on XSI-confor‐
225 mant systems.
226
227 It is recognized that the who command may be of limited usefulness,
228 especially in a multi-level secure environment. The standard developers
229 considered, however, that having some standard method of determining
230 the ``accessibility'' of other users would aid user portability.
231
232 No format was specified for the default who output for systems not sup‐
233 porting the XSI option. In such a user-oriented command, designed only
234 for human use, this was not considered to be a deficiency.
235
236 The format of the terminal name is unspecified, but the descriptions of
237 ps, talk, and write require that they use the same format.
238
239 It is acceptable for an implementation to produce no output for an
240 invocation of who mil.
241
243 None.
244
246 mesg
247
248 The Base Definitions volume of POSIX.1‐2017, Chapter 8, Environment
249 Variables, Section 12.2, Utility Syntax Guidelines
250
252 Portions of this text are reprinted and reproduced in electronic form
253 from IEEE Std 1003.1-2017, Standard for Information Technology -- Por‐
254 table Operating System Interface (POSIX), The Open Group Base Specifi‐
255 cations Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of
256 Electrical and Electronics Engineers, Inc and The Open Group. In the
257 event of any discrepancy between this version and the original IEEE and
258 The Open Group Standard, the original IEEE and The Open Group Standard
259 is the referee document. The original Standard can be obtained online
260 at http://www.opengroup.org/unix/online.html .
261
262 Any typographical or formatting errors that appear in this page are
263 most likely to have been introduced during the conversion of the source
264 files to man page format. To report such errors, see https://www.ker‐
265 nel.org/doc/man-pages/reporting_bugs.html .
266
267
268
269IEEE/The Open Group 2017 WHO(1P)