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