1WHO(P) POSIX Programmer's Manual WHO(P)
2
3
4
6 who - display who is on the system
7
9 who [-mTu]
10
11
12
13 who [-mu]-s[-bHlprt][file]
14
15 who [-mTu][-abdHlprt][file]
16
17 who -q [file]
18
19 who am i
20
21 who am I
22
23
25 The who utility shall list various pieces of information about accessi‐
26 ble users. The domain of accessibility is implementation-defined.
27
28 Based on the options given, who can also list the user's name, terminal
29 line, login time, elapsed time since activity occurred on the line, and
30 the process ID of the command interpreter for each current system user.
31
33 The who utility shall conform to the Base Definitions volume of
34 IEEE Std 1003.1-2001, Section 12.2, Utility Syntax Guidelines.
35
36 The following options shall be supported. The metavariables, such as
37 <line>, refer to fields described in the STDOUT section.
38
39 -a Process the implementation-defined database or named file with
40 the -b, -d, -l, -p, -r, -t, -T and -u options turned on.
41
42 -b Write the time and date of the last reboot.
43
44 -d Write a list of all processes that have expired and not been
45 respawned by the init system process. The <exit> field shall
46 appear for dead processes and contain the termination and exit
47 values of the dead process. This can be useful in determining
48 why a process terminated.
49
50 -H Write column headings above the regular output.
51
52 -l (The letter ell.) List only those lines on which the system is
53 waiting for someone to login. The <name> field shall be LOGIN in
54 such cases. Other fields shall be the same as for user entries
55 except that the <state> field does not exist.
56
57 -m Output only information about the current terminal.
58
59 -p List any other process that is currently active and has been
60 previously spawned by init.
61
62 -q (Quick.) List only the names and the number of users currently
63 logged on. When this option is used, all other options shall be
64 ignored.
65
66 -r Write the current run-level of the init process.
67
68 -s List only the <name>, <line>, and <time> fields. This is the
69 default case.
70
71 -t Indicate the last change to the system clock.
72
73 -T Show the state of each terminal, as described in the STDOUT sec‐
74 tion.
75
76 -u Write "idle time" for each displayed user in addition to any
77 other information. The idle time is the time since any activity
78 occurred on the user's terminal. The method of determining this
79 is unspecified. This option shall list only those users who
80 are currently logged in. The <name> is the user's login name.
81 The <line> is the name of the line as found in the directory
82 /dev. The <time> is the time that the user logged in. The
83 <activity> is the number of hours and minutes since activity
84 last occurred on that particular line. A dot indicates that the
85 terminal has seen activity in the last minute and is therefore
86 "current". If more than twenty-four hours have elapsed or the
87 line has not been used since boot time, the entry shall be
88 marked <old>. This field is useful when trying to determine
89 whether a person is working at the terminal or not. The <pid> is
90 the process ID of the user's login process.
91
92
94 The following operands shall be supported:
95
96 am i, am I
97 In the POSIX locale, limit the output to describing the invoking
98 user, equivalent to the -m option. The am and i or I must be
99 separate arguments.
100
101 file Specify a pathname of a file to substitute for the implementa‐
102 tion-defined database of logged-on users that who uses by
103 default.
104
105
107 Not used.
108
110 None.
111
113 The following environment variables shall affect the execution of who:
114
115 LANG Provide a default value for the internationalization variables
116 that are unset or null. (See the Base Definitions volume of
117 IEEE Std 1003.1-2001, Section 8.2, Internationalization Vari‐
118 ables for the precedence of internationalization variables used
119 to determine the values of locale categories.)
120
121 LC_ALL If set to a non-empty string value, override the values of all
122 the other internationalization variables.
123
124 LC_CTYPE
125 Determine the locale for the interpretation of sequences of
126 bytes of text data as characters (for example, single-byte as
127 opposed to multi-byte characters in arguments).
128
129 LC_MESSAGES
130 Determine the locale that should be used to affect the format
131 and contents of diagnostic messages written to standard error.
132
133 LC_TIME
134 Determine the locale used for the format and contents of the
135 date and time strings.
136
137 NLSPATH
138 Determine the location of message catalogs for the processing of
139 LC_MESSAGES .
140
141 TZ Determine the timezone used when writing date and time informa‐
142 tion. If TZ is unset or null, an unspecified default timezone
143 shall be used.
144
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
158 <name>[<state>]<line><time>[<activity>][<pid>][<comment>][<exit>]
159
160 The following format shall be used for the -T option:
161
162
163 "%s %c %s %s\n" <name>, <terminal state>, <terminal name>,
164 <time of login>
165
166 where <terminal state> is one of the following characters:
167
168 + The terminal allows write access to other users.
169
170 - The terminal denies write access to other users.
171
172 ? The terminal write-access state cannot be determined.
173
174
175 In the POSIX locale, the <time of login> shall be equivalent in format
176 to the output of:
177
178
179 date +"%b %e %H:%M"
180
181 If the -u option is used with -T, the idle time shall be added to the
182 end of the previous format in an unspecified format.
183
185 The standard error shall be used only for diagnostic messages.
186
188 None.
189
191 None.
192
194 The following exit values shall be returned:
195
196 0 Successful completion.
197
198 >0 An error occurred.
199
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 per‐
211 mits 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 Extension. In such a user-oriented command, designed
232 only 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
247 Portions of this text are reprinted and reproduced in electronic form
248 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
249 -- Portable Operating System Interface (POSIX), The Open Group Base
250 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
251 Electrical and Electronics Engineers, Inc and The Open Group. In the
252 event of any discrepancy between this version and the original IEEE and
253 The Open Group Standard, the original IEEE and The Open Group Standard
254 is the referee document. The original Standard can be obtained online
255 at http://www.opengroup.org/unix/online.html .
256
257
258
259IEEE/The Open Group 2003 WHO(P)