2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 .\" permission to reproduce portions of its copyrighted documentation.
4 .\" Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 .\" Group, have given us permission to reprint portions of their
11 .\" In the following statement, the phrase ``this text'' refers to portions
12 .\" of the system documentation.
14 .\" Portions of this text are reprinted and reproduced in electronic form
15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 .\" Standard for Information Technology -- Portable Operating System
17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 .\" Engineers, Inc and The Open Group. In the event of any discrepancy
20 .\" between these versions and the original IEEE and The Open Group
21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 .\" document. The original Standard can be obtained online at
23 .\" http://www.opengroup.org/unix/online.html.
25 .\" This notice shall appear on any product containing this material.
27 .\" The contents of this file are subject to the terms of the
28 .\" Common Development and Distribution License (the "License").
29 .\" You may not use this file except in compliance with the License.
31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32 .\" or http://www.opensolaris.org/os/licensing.
33 .\" See the License for the specific language governing permissions
34 .\" and limitations under the License.
36 .\" When distributing Covered Code, include this CDDL HEADER in each
37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38 .\" If applicable, add the following below this CDDL HEADER, with the
39 .\" fields enclosed by brackets "[]" replaced with your own identifying
40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
43 .\" Copyright 1989 AT&T
44 .\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
45 .\" Copyright (c) 2000, Sun Microsystems, Inc. All Rights Reserved
47 .TH WHO 1 "Oct 25, 2017"
49 who \- who is on the system
53 \fB/usr/bin/who\fR [\fB-abdHlmpqrtTu\fR] [\fIfile\fR]
58 \fB/usr/bin/who\fR \fB-q\fR [\fB-n\fR \fIx\fR] [\fIfile\fR]
63 \fB/usr/bin/who\fR \fB-s\fR [\fB-bdHlmpqrtu\fR] [\fIfile\fR]
68 \fB/usr/bin/who\fR am i
73 \fB/usr/bin/who\fR am I
78 The \fBwho\fR utility can list the user's name, terminal line, login time,
79 elapsed time since activity occurred on the line, and the process-ID of the
80 command interpreter (shell) for each current UNIX system user. It examines the
81 \fB/var/adm/utmpx\fR file to obtain its information. If \fIfile\fR is given,
82 that file (which must be in \fButmpx\fR(4) format) is examined. Usually,
83 \fIfile\fR will be \fB/var/adm/wtmpx\fR, which contains a history of all the
84 logins since the file was last created.
87 The general format for output is:
91 \fIname\fR [\fIstate\fR] \fIline time\fR [\fIidle\fR] [\fIpid\fR] [\fIcomment\fR] [\fIexit\fR]
114 Capability of writing to the terminal
123 Name of the line found in \fB/dev\fR
132 Time since user's login
141 Time elapsed since the user's last activity
159 Comment line in \fBinittab\fR(4)
168 Exit status for dead processes
173 The following options are supported:
180 Processes \fB/var/adm/utmpx\fR or the named \fIfile\fR with \fB-b\fR, \fB-d\fR,
181 \fB-l\fR, \fB-p\fR, \fB-r\fR, \fB-t\fR, \fB-T\fR, and \fB-u\fR options turned
191 Indicates the time and date of the last reboot.
200 Displays all processes that have expired and not been respawned by \fBinit\fR.
201 The \fBexit\fR field appears for dead processes and contains the termination
202 and exit values of the dead process. This
203 can be useful in determining why a process terminated.
212 Outputs column headings above the regular output.
221 Lists only those lines on which the system is waiting for someone to login. The
222 \fIname\fR field is \fBLOGIN\fR in such cases. Other fields are the same as for
223 user entries except that the \fIstate\fR field does not exist.
232 Outputs only information about the current terminal.
238 \fB\fB-n\fR \fIx\fR \fR
241 Takes a numeric argument, \fIx\fR, which specifies the number of users to
242 display per line. \fIx\fR must be at least \fB1\fR. The \fB-n\fR option can
243 only be used with \fB-q\fR.
252 Lists any other process that is currently active and has been previously
253 spawned by \fBinit\fR. The \fIname\fR field is the name of the program executed
254 by \fBinit\fR as found in \fB/sbin/inittab\fR. The \fIstate\fR, \fIline\fR, and
255 \fIidle\fR fields have no meaning. The \fIcomment\fR field shows the \fBid\fR
256 field of the line from \fB/sbin/inittab\fR that spawned this process. See
266 (Quick \fBwho\fR) Displays only the names and the number of users currently
267 logged on. When this option is used, all other options are ignored.
276 Indicates the current \fIrun-level\fR of the \fBinit\fR process.
285 (Default) Lists only the \fIname\fR, \fIline\fR, and \fItime\fR fields.
294 Same as the \fB-s\fR option, except that the \fIstate\fR field is also written.
295 \fIstate\fR is one of the characters listed under the \fB/usr/bin/who\fR
296 version of this option. If the \fB-u\fR option is used with \fB-T\fR, the idle
297 time is added to the end of the previous format.
306 Indicates the last change to the system clock (using the \fBdate\fR utility) by
307 \fBroot\fR. See \fBsu\fR(8) and \fBdate\fR(1).
316 Lists only those users who are currently logged in. The \fIname\fR is the
317 user's login name. The \fIline\fR is the name of the line as found in the
318 directory \fB/dev\fR. The \fItime\fR is the time that the user logged in. The
319 \fIidle\fR column contains the number of hours and minutes since activity last
320 occurred on that particular line. A dot (\fB\&.\fR) indicates that the terminal
321 has seen activity in the last minute and is therefore ``current.'' If more than
322 twenty-four hours have elapsed or the line has not been used since boot time,
323 the entry is marked \fBold\fR. This field is useful when trying to determine
324 whether a person is working at the terminal or not. The \fIpid\fR is the
325 process-ID of the user's shell. The \fIcomment\fR is the comment field
326 associated with this line as found in \fB/sbin/inittab\fR (see
327 \fBinittab\fR(4)). This can contain information about where the terminal is
328 located, the telephone number of the dataset, type of terminal if hard-wired,
334 The following operands are supported:
338 \fB\fBam\fR \fBi\fR \fR
342 \fB\fBam\fR \fBI\fR \fR
345 In the "C" locale, limits the output to describing the invoking user,
346 equivalent to the \fB-m\fR option. The \fBam\fR and \fBi\fR or \fBI\fR must be
356 Specifies a path name of a file to substitute for the database of logged-on
357 users that \fBwho\fR uses by default.
360 .SH ENVIRONMENT VARIABLES
362 See \fBenviron\fR(5) for descriptions of the following environment variables
363 that affect the execution of \fBwho\fR: \fBLANG\fR, \fBLC_ALL\fR,
364 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, \fBLC_TIME\fR, and \fBNLSPATH\fR.
367 The following exit values are returned:
374 Successful completion.
389 \fB\fB/sbin/inittab\fR \fR
392 Script for \fBinit\fR
398 \fB\fB/var/adm/utmpx\fR \fR
401 Current user and accounting information
407 \fB\fB/var/adm/wtmpx\fR \fR
410 Historic user and accounting information
415 See \fBattributes\fR(5) for descriptions of the following attributes:
420 ATTRIBUTE TYPE ATTRIBUTE VALUE
422 Interface Stability Standard
427 \fBdate\fR(1), \fBlogin\fR(1), \fBmesg\fR(1), \fBinit\fR(8), \fBsu\fR(8),
428 \fBinittab\fR(4), \fButmpx\fR(4), \fBattributes\fR(5),
429 \fBenviron\fR(5), \fBstandards\fR(5)
432 \fBSuperuser:\fR After a shutdown to the single-user state, \fBwho\fR returns a
433 prompt. Since \fB/var/adm/utmpx\fR is updated at login time and there is no
434 login in single-user state, \fBwho\fR cannot report accurately on this state.
435 The command, \fBwho\fR \fBam i\fR, however, returns the correct information.