1who(1) User Commands who(1)
2
3
4
6 who - who is on the system
7
9 /usr/bin/who [-abdHlmpqrstTu] [file]
10
11
12 /usr/bin/who -q [-n x] [file]
13
14
15 /usr/bin/who am i
16
17
18 /usr/bin/who am I
19
20
21 /usr/xpg4/bin/who [-abdHlmpqrtTu] [file]
22
23
24 /usr/xpg4/bin/who -q [-n x] [file]
25
26
27 /usr/xpg4/bin/who -s [-bdHlmpqrtu] [file]
28
29
30 /usr/xpg4/bin/who am i
31
32
33 /usr/xpg4/bin/who am I
34
35
37 The who utility can list the user's name, terminal line, login time,
38 elapsed time since activity occurred on the line, and the process-ID of
39 the command interpreter (shell) for each current UNIX system user. It
40 examines the /var/adm/utmpx file to obtain its information. If file is
41 given, that file (which must be in utmpx(4) format) is examined. Usu‐
42 ally, file will be /var/adm/wtmpx, which contains a history of all the
43 logins since the file was last created.
44
45
46 The general format for output is:
47
48 name [state] line time [idle] [pid] [comment] [exit]
49
50
51
52
53 where:
54
55 name User's login name
56
57
58 state Capability of writing to the terminal
59
60
61 line Name of the line found in /dev
62
63
64 time Time since user's login
65
66
67 idle Time elapsed since the user's last activity
68
69
70 pid User's process id
71
72
73 comment Comment line in inittab(4)
74
75
76 exit Exit status for dead processes
77
78
80 The following options are supported:
81
82 -a Processes /var/adm/utmpx or the named file with -b, -d, -l,
83 -p, -r, -t, -T, and -u options turned on.
84
85
86 -b Indicates the time and date of the last reboot.
87
88
89 -d Displays all processes that have expired and not been
90 respawned by init. The exit field appears for dead processes
91 and contains the termination and exit values (as returned by
92 wait(3UCB)), of the dead process. This can be useful in deter‐
93 mining why a process terminated.
94
95
96 -H Outputs column headings above the regular output.
97
98
99 -l Lists only those lines on which the system is waiting for
100 someone to login. The name field is LOGIN in such cases. Other
101 fields are the same as for user entries except that the state
102 field does not exist.
103
104
105 -m Outputs only information about the current terminal.
106
107
108 -n x Takes a numeric argument, x, which specifies the number of
109 users to display per line. x must be at least 1. The -n option
110 can only be used with -q.
111
112
113 -p Lists any other process that is currently active and has been
114 previously spawned by init. The name field is the name of the
115 program executed by init as found in /sbin/inittab. The state,
116 line, and idle fields have no meaning. The comment field shows
117 the id field of the line from /sbin/inittab that spawned this
118 process. See inittab(4).
119
120
121 -q (Quick who) Displays only the names and the number of users
122 currently logged on. When this option is used, all other
123 options are ignored.
124
125
126 -r Indicates the current run-level of the init process.
127
128
129 -s (Default) Lists only the name, line, and time fields.
130
131
132 /usr/bin/who
133 -T Same as the -s option, except that the state idle, pid, and com‐
134 ment, fields are also written. state is one of the following
135 characters:
136
137 + The terminal allows write access to other users.
138
139
140 − The terminal denies write access to other users.
141
142
143 ? The terminal write-access state cannot be determined.
144
145
146
147 /usr/xpg4/bin/who
148 -T Same as the -s option, except that the state field is also writ‐
149 ten. state is one of the characters listed under the
150 /usr/bin/who version of this option. If the -u option is used
151 with -T, the idle time is added to the end of the previous for‐
152 mat.
153
154
155 -t Indicates the last change to the system clock (using the date
156 utility) by root. See su(1M) and date(1).
157
158
159 -u Lists only those users who are currently logged in. The name is
160 the user's login name. The line is the name of the line as found
161 in the directory /dev. The time is the time that the user logged
162 in. The idle column contains the number of hours and minutes
163 since activity last occurred on that particular line. A dot (.)
164 indicates that the terminal has seen activity in the last minute
165 and is therefore ``current.'' If more than twenty-four hours
166 have elapsed or the line has not been used since boot time, the
167 entry is marked old. This field is useful when trying to deter‐
168 mine whether a person is working at the terminal or not. The pid
169 is the process-ID of the user's shell. The comment is the com‐
170 ment field associated with this line as found in /sbin/inittab
171 (see inittab(4)). This can contain information about where the
172 terminal is located, the telephone number of the dataset, type
173 of terminal if hard-wired, and so forth.
174
175
177 The following operands are supported:
178
179 am i In the "C" locale, limits the output to describing the invok‐
180 am I ing user, equivalent to the -m option. The am and i or I must
181 be separate arguments.
182
183
184 file Specifies a path name of a file to substitute for the database
185 of logged-on users that who uses by default.
186
187
189 See environ(5) for descriptions of the following environment variables
190 that affect the execution of who: LANG, LC_ALL, LC_CTYPE, LC_MESSAGES,
191 LC_TIME, and NLSPATH.
192
194 The following exit values are returned:
195
196 0 Successful completion.
197
198
199 >0 An error occurred.
200
201
203 /sbin/inittab Script for init
204
205
206 /var/adm/utmpx Current user and accounting information
207
208
209 /var/adm/wtmpx Historic user and accounting information
210
211
213 See attributes(5) for descriptions of the following attributes:
214
215 /usr/bin/who
216 ┌─────────────────────────────┬─────────────────────────────┐
217 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
218 ├─────────────────────────────┼─────────────────────────────┤
219 │Availability │SUNWcsu │
220 └─────────────────────────────┴─────────────────────────────┘
221
222 /usr/xpg4/bin/who
223 ┌─────────────────────────────┬─────────────────────────────┐
224 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
225 ├─────────────────────────────┼─────────────────────────────┤
226 │Availability │SUNWxcu4 │
227 ├─────────────────────────────┼─────────────────────────────┤
228 │Interface Stability │Standard │
229 └─────────────────────────────┴─────────────────────────────┘
230
232 date(1), login(1), mesg(1), init(1M), su(1M), wait(3UCB), inittab(4),
233 utmpx(4), attributes(5), environ(5), standards(5)
234
236 Superuser: After a shutdown to the single-user state, who returns a
237 prompt. Since /var/adm/utmpx is updated at login time and there is no
238 login in single-user state, who cannot report accurately on this state.
239 The command, who am i, however, returns the correct information.
240
241
242
243SunOS 5.11 3 Nov 2000 who(1)